Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions openapi/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ paths:
$ref: paths/utils/random/string/index.yaml
"/utils/sort/{collection}":
$ref: paths/utils/sort/_collection/index.yaml
"/utils/translations/generate":
$ref: paths/utils/translations/generate/index.yaml
"/versions":
$ref: paths/versions/index.yaml
"/versions‎":
Expand Down
2 changes: 2 additions & 0 deletions openapi/paths/utils/translations/generate/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
post:
$ref: translations-generate.yaml
104 changes: 104 additions & 0 deletions openapi/paths/utils/translations/generate/translations-generate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
summary: Generate Translations Collection
description: Creates the full translations infrastructure (collections, fields, relationships) for a given source collection. Requires administrator access.
operationId: translations-generate
requestBody:
content:
application/json:
schema:
type: object
properties:
collection:
type: string
description: The source collection to enable translations for.
example: articles
fields:
type: array
items:
type: string
minItems: 1
description: Field names from the source collection to make translatable.
example:
- title
- content
translationsCollection:
type: string
description: Custom name for the translations junction collection. Defaults to `{collection}_translations`.
languagesCollection:
type: string
description: Name of the languages collection to use or create. Defaults to `languages`.
parentFkField:
type: string
description: Custom name for the foreign key field referencing the source collection.
languageFkField:
type: string
description: Custom name for the foreign key field referencing the languages collection.
createLanguagesCollection:
type: boolean
default: true
description: Whether to create the languages collection if it does not exist.
seedLanguages:
type: boolean
default: true
description: Whether to seed the languages collection with common languages when creating it.
required:
- collection
- fields
responses:
'200':
content:
application/json:
schema:
type: object
properties:
data:
oneOf:
- type: object
title: Created
description: Returned when a new translations collection is created.
properties:
created:
type: boolean
enum:
- true
translationsCollection:
type: string
example: articles_translations
languagesCollection:
type: string
example: languages
fields:
type: array
items:
type: string
example:
- title
- content
required:
- created
- translationsCollection
- languagesCollection
- fields
- type: object
title: Fields Added
description: Returned when fields are added to an existing translations collection.
properties:
created:
type: boolean
enum:
- false
translationsCollection:
type: string
example: articles_translations
fields:
type: array
items:
type: string
example:
- summary
required:
- created
- translationsCollection
- fields
description: Successful request
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new utils endpoint is missing the security: [] field that other utility operations consistently include (e.g., openapi/paths/utils/hash/generate/hash-generate.yaml and openapi/paths/utils/cache/clear/clear-cache.yaml). Please add it for consistency with the existing OpenAPI operation objects in this repo.

Suggested change
description: Successful request
description: Successful request
security: []

Copilot uses AI. Check for mistakes.
tags:
- Utilities
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting nit: this file uses tags:\n - Utilities while the rest of the OpenAPI files in this repo typically use tags:\n- Utilities (no extra indentation). Consider matching the existing style to minimize diff churn and keep formatting consistent across generated specs.

Suggested change
- Utilities
- Utilities

Copilot uses AI. Check for mistakes.