Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): Adjust job_template_locale properties #772

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
28 changes: 26 additions & 2 deletions doc/compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -1450,6 +1450,28 @@
"code": "en-GB"
}
},
"locale_preview_global": {
"type": "object",
"title": "locale_preview_global",
"properties": {
"id": {
"type": "string",
"nullable": true,
"description": "The ID of the locale. Global Job Templates will return `null` here."
},
"name": {
"type": "string"
},
"code": {
"type": "string"
}
},
"example": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "English",
"code": "en-GB"
}
},
"locale": {
"type": "object",
"title": "locale",
Expand Down Expand Up @@ -3279,7 +3301,9 @@
"title": "job_template_locale",
"properties": {
"id": {
"type": "string"
"type": "string",
"nullable": true,
"description": "The ID of the job template locale. Will return `null` if the related `job_template` is global."
Comment on lines +3304 to +3306
Copy link
Contributor

Choose a reason for hiding this comment

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

Issue: If I'm not mistaken, we need to change the locale_preview schema so it can also just show the fields name and code. That would be in line 1433. But maybe it's better to create a new schema because the field id won't be showing at all.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree, I'd vote for a separate schema

},
"job_template": {
"type": "object",
Expand All @@ -3295,7 +3319,7 @@
"example": null
},
"locale": {
"$ref": "#/components/schemas/locale_preview"
"$ref": "#/components/schemas/locale_preview_global"
},
"users": {
"type": "array",
Expand Down
2 changes: 2 additions & 0 deletions schemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ schemas:
"$ref": schemas/project_report.yaml#/project_report
locale_preview:
"$ref": schemas/locale_preview.yaml#/locale_preview
locale_preview_global:
"$ref": schemas/locale_preview_global.yaml#/locale_preview_global
locale:
"$ref": schemas/locale.yaml#/locale
locale_download:
Expand Down
4 changes: 3 additions & 1 deletion schemas/job_template_locale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ job_template_locale:
properties:
id:
type: string
nullable: true
description: The ID of the job template locale. Will return `null` if the related `job_template` is global.
job_template:
"$ref": "./job_template_preview.yaml#/job_template_preview"
locale:
"$ref": "./locale_preview.yaml#/locale_preview"
"$ref": "./locale_preview_global.yaml#/locale_preview_global"
users:
type: array
items:
Expand Down
17 changes: 17 additions & 0 deletions schemas/locale_preview_global.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
locale_preview_global:
type: object
title: locale_preview_global
properties:
id:
type: string
nullable: true
description: The ID of the locale. Global Job Templates will return `null` here.
name:
type: string
code:
type: string
example:
id: abcd1234cdef1234abcd1234cdef1234
name: English
code: en-GB
Loading