Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09dc88c
commit 5455dc8
Showing
3 changed files
with
140 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
info: | ||
title: Turbogate Example API | ||
version: 0.0.0 | ||
servers: | ||
- url: https://urapiid.execute-api.eu-central-1.amazonaws.com/prod | ||
description: Development server | ||
openapi: 3.1.0 | ||
components: | ||
securitySchemes: | ||
apiKey: | ||
type: apiKey | ||
in: header | ||
name: Authorization | ||
schemas: | ||
Item: | ||
type: object | ||
properties: | ||
id: | ||
type: string | ||
format: uuid | ||
description: The ID of the item. Generated by the backend upon creation. | ||
name: | ||
type: string | ||
minLength: 5 | ||
maxLength: 20 | ||
description: >- | ||
The name of the item. Does not have to be unique and can be changed | ||
at any given time. | ||
example: Excellent Item | ||
description: | ||
type: string | ||
description: The description of the item. Can be changed at any given time. | ||
example: This item is of exceptional excellence. | ||
required: | ||
- id | ||
- name | ||
additionalProperties: false | ||
description: An item. | ||
ZodValidationError: | ||
type: object | ||
properties: | ||
validationErrors: | ||
type: array | ||
items: | ||
type: object | ||
properties: | ||
code: | ||
type: string | ||
enum: | ||
- invalid_type | ||
- invalid_literal | ||
- custom | ||
- invalid_union | ||
- invalid_union_discriminator | ||
- invalid_enum_value | ||
- unrecognized_keys | ||
- invalid_arguments | ||
- invalid_return_type | ||
- invalid_date | ||
- invalid_string | ||
- too_small | ||
- too_big | ||
- invalid_intersection_types | ||
- not_multiple_of | ||
- not_finite | ||
message: | ||
type: string | ||
path: | ||
type: array | ||
items: | ||
type: string | ||
required: | ||
- code | ||
- message | ||
- path | ||
description: A list of Zod validation errors. | ||
required: | ||
- validationErrors | ||
parameters: {} | ||
paths: | ||
/items: | ||
post: | ||
summary: Creates a new item | ||
description: >- | ||
Creates a new item in the database. The ID of the item is generated by | ||
the backend. Upon success the whole item including the ID is returned. | ||
security: | ||
- apiKey: [] | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
minLength: 5 | ||
maxLength: 20 | ||
description: >- | ||
The name of the item. Does not have to be unique and can be | ||
changed at any given time. | ||
example: Excellent Item | ||
description: | ||
type: string | ||
description: >- | ||
The description of the item. Can be changed at any given | ||
time. | ||
example: This item is of exceptional excellence. | ||
required: | ||
- name | ||
additionalProperties: false | ||
responses: | ||
'201': | ||
description: >- | ||
The item was created successfully. The whole created item is | ||
returned. | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Item' | ||
'400': | ||
description: The validation of the request failed. | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/ZodValidationError' | ||
'500': | ||
description: Internal server error. | ||
content: | ||
application/json: | ||
schema: {} | ||
webhooks: {} |