diff --git a/doc/compiled.json b/doc/compiled.json index d59f471ca..8924c7ad8 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -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", @@ -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." }, "job_template": { "type": "object", @@ -3295,7 +3319,7 @@ "example": null }, "locale": { - "$ref": "#/components/schemas/locale_preview" + "$ref": "#/components/schemas/locale_preview_global" }, "users": { "type": "array", diff --git a/schemas.yaml b/schemas.yaml index 2cdd8e6d7..cb6020956 100644 --- a/schemas.yaml +++ b/schemas.yaml @@ -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: diff --git a/schemas/job_template_locale.yaml b/schemas/job_template_locale.yaml index ae078e772..6466234d2 100644 --- a/schemas/job_template_locale.yaml +++ b/schemas/job_template_locale.yaml @@ -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: diff --git a/schemas/locale_preview_global.yaml b/schemas/locale_preview_global.yaml new file mode 100644 index 000000000..5a1f0cb5d --- /dev/null +++ b/schemas/locale_preview_global.yaml @@ -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