From 798451ee31de8cb049a31c0ba533238d9f7f3e27 Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Sun, 28 May 2023 13:32:43 +0200 Subject: [PATCH 1/2] Revert "Removed obsolete parameters from OpenAPI specs" This reverts commit 07954bf2faffa5cd8bb54898a807680c06b532db. The @type annotation should be still part of the OpenAPI description. Although the returned JSON objects are considered compatible with the schema.org standard, this does not mean, we should not make the implications explicit. Also, this makes reading more clean and avoid misunderstandings regarding if the @type is to be present or not. Signed-off-by: Christian Wolf --- docs/dev/api/0.1.0/objects.yaml | 10 ++++++++++ docs/dev/api/0.1.1/objects.yaml | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/docs/dev/api/0.1.0/objects.yaml b/docs/dev/api/0.1.0/objects.yaml index 599121a08..070832ee1 100644 --- a/docs/dev/api/0.1.0/objects.yaml +++ b/docs/dev/api/0.1.0/objects.yaml @@ -110,6 +110,10 @@ Instruction: Nutrition: type: object properties: + "@type": + type: string + example: NutritionInformation + description: Schema.org object description calories: type: string description: The number of calories for the given amount @@ -158,6 +162,8 @@ Nutrition: type: string description: The number of grams of unsaturated fat example: 40 g + required: + - "@type" Recipe: #type: object @@ -166,6 +172,10 @@ Recipe: - $ref: "#/RecipeStubInformation" - type: object properties: + "@type": + type: string + example: "Recipe" + description: Schema.org object type identifier id: type: string description: The index of the recipe. Note the representation as a string as the representation might change in the future. diff --git a/docs/dev/api/0.1.1/objects.yaml b/docs/dev/api/0.1.1/objects.yaml index 1bf699f75..abeded831 100644 --- a/docs/dev/api/0.1.1/objects.yaml +++ b/docs/dev/api/0.1.1/objects.yaml @@ -167,6 +167,11 @@ Instruction: Nutrition: type: object properties: + "@type": + type: string + example: NutritionInformation + description: Schema.org object description + default: NutritionInformation calories: type: string description: The number of calories for the given amount @@ -215,6 +220,8 @@ Nutrition: type: string description: The number of grams of unsaturated fat example: 40 g + required: + - "@type" Recipe: #type: object @@ -223,6 +230,11 @@ Recipe: - $ref: "#/RecipeStubInformation" - type: object properties: + "@type": + type: string + example: "Recipe" + default: Recipe + description: Schema.org object type identifier id: type: string description: The index of the recipe. Note the representation as a string as the representation might change in the future. From 219e3a9ce2258b359beb1d6ac48519da9c1fd2df Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Sun, 28 May 2023 13:41:37 +0200 Subject: [PATCH 2/2] Update changelog Signed-off-by: Christian Wolf --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cf447696..e3f243527 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ [#1680](https://github.com/nextcloud/cookbook/pull/1680) @dependabot - Fix bug in browser console [#1686](https://github.com/nextcloud/cookbook/pull/1686) @christianlupus +- Make OpenAPI specs more compatible regarding `@type` + [#1700](https://github.com/nextcloud/cookbook/pull/1700) @christianlupus ## 0.10.2 - 2023-03-24