diff --git a/CHANGELOG.md b/CHANGELOG.md index ca3e6bb82..3a521b919 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ ### Documentation - Add documentation on updates of the API endpoints [#1001](https://github.com/nextcloud/cookbook/pull/1001) @christianlupus +- Fix API specification in accordance with real implementation + [#1006](https://github.com/nextcloud/cookbook/pull/1006) @christianlupus ## 0.9.12 - 2022-05-12 diff --git a/docs/dev/api/0.0.2/openapi-cookbook.yaml b/docs/dev/api/0.0.2/openapi-cookbook.yaml index 0e7115394..5326b4745 100644 --- a/docs/dev/api/0.0.2/openapi-cookbook.yaml +++ b/docs/dev/api/0.0.2/openapi-cookbook.yaml @@ -172,6 +172,50 @@ components: description: The line where the exception is thrown example: 223 + RecipeStub: + type: object + description: A stub of a recipe with some basic information present + properties: + name: + type: string + description: The name of the recipe + example: Baked bananas + recipe_id: + type: integer + description: The index of the recipe + example: 1 + keywords: + type: string + description: A comma-separated list of recipe keywords + example: sweets,fruit + dateCreated: + type: string + description: The date the recipe was created in the app + example: "2022-01-02T16:12:41+0000" + dateModified: + type: string + description: The date the recipe was modified lastly in the app + example: "2022-01-10T10:02:52+0000" + imageUrl: + type: string + description: The URL of the recipe image + example: http://example.com/path/to/image.jpg + imagePlaceholderUrl: + type: string + description: The URL of the placeholder of the recipe image + example: http://example.com/path/to/image_thumb.jpg + required: + - "name" + - "recipe_id" + - "imageUrl" + - "imagePlaceholderUrl" + - "dateCreated" + + StubList: + type: array + items: + $ref: "#/components/schemas/RecipeStub" + securitySchemes: app_password: type: http @@ -388,7 +432,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/RecipeList" + $ref: "#/components/schemas/StubList" post: tags: [ Recipes ] summary: Create a new recipe diff --git a/docs/dev/api/0.0.3/openapi-cookbook.yaml b/docs/dev/api/0.0.3/openapi-cookbook.yaml index d7fb9e925..b42deb93e 100644 --- a/docs/dev/api/0.0.3/openapi-cookbook.yaml +++ b/docs/dev/api/0.0.3/openapi-cookbook.yaml @@ -172,6 +172,50 @@ components: description: The line where the exception is thrown example: 223 + RecipeStub: + type: object + description: A stub of a recipe with some basic information present + properties: + name: + type: string + description: The name of the recipe + example: Baked bananas + recipe_id: + type: integer + description: The index of the recipe + example: 1 + keywords: + type: string + description: A comma-separated list of recipe keywords + example: sweets,fruit + dateCreated: + type: string + description: The date the recipe was created in the app + example: "2022-01-02T16:12:41+0000" + dateModified: + type: string + description: The date the recipe was modified lastly in the app + example: "2022-01-10T10:02:52+0000" + imageUrl: + type: string + description: The URL of the recipe image + example: http://example.com/path/to/image.jpg + imagePlaceholderUrl: + type: string + description: The URL of the placeholder of the recipe image + example: http://example.com/path/to/image_thumb.jpg + required: + - "name" + - "recipe_id" + - "imageUrl" + - "imagePlaceholderUrl" + - "dateCreated" + + StubList: + type: array + items: + $ref: "#/components/schemas/RecipeStub" + securitySchemes: app_password: type: http @@ -399,7 +443,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/RecipeList" + $ref: "#/components/schemas/StubList" post: tags: [ Recipes ] summary: Create a new recipe