From cc1c860ceaf79a3d7b9d16a84aa4458c3ab592c4 Mon Sep 17 00:00:00 2001 From: Michael Blum Date: Wed, 29 Jan 2025 15:11:53 +0100 Subject: [PATCH 1/2] chore(docs): Adjust job_template_locale properties --- doc/compiled.json | 4 +++- schemas/job_template_locale.yaml | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/compiled.json b/doc/compiled.json index d59f471ca..8548f731f 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -3279,7 +3279,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", diff --git a/schemas/job_template_locale.yaml b/schemas/job_template_locale.yaml index ae078e772..8ac40d448 100644 --- a/schemas/job_template_locale.yaml +++ b/schemas/job_template_locale.yaml @@ -5,6 +5,8 @@ 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: From 646b5c7505440f4546899b57cadf45e7df2dd8e0 Mon Sep 17 00:00:00 2001 From: Michael Blum Date: Fri, 7 Feb 2025 14:26:41 +0100 Subject: [PATCH 2/2] Fix comment: Also consider locale-schema.yaml --- doc/compiled.json | 24 +++++++++++++++++++++++- schemas.yaml | 2 ++ schemas/job_template_locale.yaml | 2 +- schemas/locale_preview_global.yaml | 17 +++++++++++++++++ 4 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 schemas/locale_preview_global.yaml diff --git a/doc/compiled.json b/doc/compiled.json index 8548f731f..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", @@ -3297,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 8ac40d448..6466234d2 100644 --- a/schemas/job_template_locale.yaml +++ b/schemas/job_template_locale.yaml @@ -10,7 +10,7 @@ job_template_locale: 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