docs: add OpenAPI documentation
This commit is contained in:
23
openapi/paths/account-register.yaml
Normal file
23
openapi/paths/account-register.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
post:
|
||||
tags:
|
||||
- Account
|
||||
summary: "Register an account"
|
||||
operationId: "RegisterAccount"
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "../schemas/Account.yaml"
|
||||
examples:
|
||||
accountIn:
|
||||
$ref: "../examples/AccountIn.yaml"
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: "OK"
|
||||
"400":
|
||||
description: "Bad Request"
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
$ref: "../schemas/ProblemDetail.yaml"
|
||||
0
openapi/paths/recipe-api-bundled.yaml
Normal file
0
openapi/paths/recipe-api-bundled.yaml
Normal file
50
openapi/paths/recipe-new.yaml
Normal file
50
openapi/paths/recipe-new.yaml
Normal file
@@ -0,0 +1,50 @@
|
||||
post:
|
||||
tags:
|
||||
- Recipe
|
||||
summary: "Add a recipe"
|
||||
operationId: "addRecipe"
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "../schemas/Recipe.yaml"
|
||||
examples:
|
||||
recipeIn:
|
||||
$ref: "../examples/HummusV1In.yaml"
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
description: OK
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
$ref: "../schemas/Recipe.yaml"
|
||||
examples:
|
||||
recipeOut:
|
||||
$ref: "../examples/HummusV1Out.yaml"
|
||||
400:
|
||||
description: Bad Request
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
$ref: "../schemas/ProblemDetail.yaml"
|
||||
401:
|
||||
description: Unauthorized
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
$ref: "../schemas/ProblemDetail.yaml"
|
||||
403:
|
||||
description: Forbidden
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
$ref: "../schemas/ProblemDetail.yaml"
|
||||
404:
|
||||
description: Not Found
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
$ref: "../schemas/ProblemDetail.yaml"
|
||||
security:
|
||||
- httpBasic: [ ]
|
||||
59
openapi/paths/recipe-search.yaml
Normal file
59
openapi/paths/recipe-search.yaml
Normal file
@@ -0,0 +1,59 @@
|
||||
get:
|
||||
tags:
|
||||
- Recipe
|
||||
summary: "Find recipes"
|
||||
operationId: "FindRecipes"
|
||||
parameters:
|
||||
- name: "category"
|
||||
in: "query"
|
||||
required: false
|
||||
schema:
|
||||
type: "string"
|
||||
description: "Category name filter (equals, ignores case)"
|
||||
- name: "recipe"
|
||||
in: "query"
|
||||
required: false
|
||||
schema:
|
||||
type: "string"
|
||||
description: "Recipe name filter (contains, ignores case)"
|
||||
- name: "limit"
|
||||
in: "query"
|
||||
required: true
|
||||
schema:
|
||||
type: "integer"
|
||||
format: "int64"
|
||||
minimum: 1
|
||||
maximum: 100
|
||||
description: "Maximum number of recipes to return"
|
||||
- name: "offset"
|
||||
in: "query"
|
||||
required: true
|
||||
schema:
|
||||
type: "integer"
|
||||
format: "int64"
|
||||
minimum: 0
|
||||
description: "Index into result set from where recipes will start to be returned"
|
||||
responses:
|
||||
200:
|
||||
description: OK
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
type: "array"
|
||||
items:
|
||||
$ref: "../schemas/Recipe.yaml"
|
||||
examples:
|
||||
dipsOut:
|
||||
$ref: "../examples/DipsOut.yaml"
|
||||
400:
|
||||
description: Bad Request
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
$ref: "../schemas/ProblemDetail.yaml"
|
||||
404:
|
||||
description: Not Found
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
$ref: "../schemas/ProblemDetail.yaml"
|
||||
117
openapi/paths/recipe-{recipeId}.yaml
Normal file
117
openapi/paths/recipe-{recipeId}.yaml
Normal file
@@ -0,0 +1,117 @@
|
||||
get:
|
||||
tags:
|
||||
- Recipe
|
||||
summary: "Get a recipe"
|
||||
operationId: "GetRecipe"
|
||||
parameters:
|
||||
- $ref: "../parameters/{recipeId}.yaml"
|
||||
responses:
|
||||
200:
|
||||
description: OK
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
$ref: "../schemas/Recipe.yaml"
|
||||
examples:
|
||||
recipeOut:
|
||||
$ref: "../examples/HummusV1Out.yaml"
|
||||
400:
|
||||
description: Bad Request
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
$ref: "../schemas/ProblemDetail.yaml"
|
||||
404:
|
||||
description: Not Found
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
$ref: "../schemas/ProblemDetail.yaml"
|
||||
put:
|
||||
tags:
|
||||
- Recipe
|
||||
summary: "Update a recipe"
|
||||
operationId: "UpdateRecipe"
|
||||
parameters:
|
||||
- $ref: "../parameters/{recipeId}.yaml"
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "../schemas/Recipe.yaml"
|
||||
examples:
|
||||
recipeIn:
|
||||
$ref: "../examples/HummusV2In.yaml"
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
description: OK
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
$ref: "../schemas/Recipe.yaml"
|
||||
examples:
|
||||
recipeOut:
|
||||
$ref: "../examples/HummusV2Out.yaml"
|
||||
400:
|
||||
description: Bad Request
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
$ref: "../schemas/ProblemDetail.yaml"
|
||||
401:
|
||||
description: Unauthorized
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
$ref: "../schemas/ProblemDetail.yaml"
|
||||
403:
|
||||
description: Forbidden
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
$ref: "../schemas/ProblemDetail.yaml"
|
||||
404:
|
||||
description: Not Found
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
$ref: "../schemas/ProblemDetail.yaml"
|
||||
security:
|
||||
- httpBasic: [ ]
|
||||
delete:
|
||||
tags:
|
||||
- Recipe
|
||||
summary: "Remove a recipe"
|
||||
operationId: "RemoveRecipe"
|
||||
parameters:
|
||||
- $ref: "../parameters/{recipeId}.yaml"
|
||||
responses:
|
||||
200:
|
||||
description: OK
|
||||
400:
|
||||
description: Bad Request
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
$ref: "../schemas/ProblemDetail.yaml"
|
||||
401:
|
||||
description: Unauthorized
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
$ref: "../schemas/ProblemDetail.yaml"
|
||||
403:
|
||||
description: Forbidden
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
$ref: "../schemas/ProblemDetail.yaml"
|
||||
404:
|
||||
description: Not Found
|
||||
content:
|
||||
"application/json":
|
||||
schema:
|
||||
$ref: "../schemas/ProblemDetail.yaml"
|
||||
security:
|
||||
- httpBasic: [ ]
|
||||
Reference in New Issue
Block a user