diff --git a/Sources/AmiiboService/openapi.yaml b/Sources/AmiiboService/openapi.yaml index e3fba9a..12d656e 100644 --- a/Sources/AmiiboService/openapi.yaml +++ b/Sources/AmiiboService/openapi.yaml @@ -56,17 +56,24 @@ externalDocs: paths: /amiibo: get: + summary: Get a list of Amiibo items. description: Get a list of all the Amiibo items available in the database. operationId: getAmiibos + tags: + - Amiibo responses: '200': - description: Successful response returning the object that contains a list of Amiibo items. + description: Response that retuns a decodable JSON object containing a list of Amiibo items. content: application/json: schema: $ref: '#/components/schemas/AmiiboWrapper' '400': - description: Bad Amiibo request. + $ref: '#/components/responses/BadRequest' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/Unavailable' parameters: - name: amiiboSeries in: query @@ -124,24 +131,21 @@ paths: schema: type: string style: form - /amiiboseries: get: description: Get a list of all the Amiibo series available in the database. operationId: getAmiiboSeries + tags: + - Amiibo responses: '200': - description: Successful response returning the object that contains a list of Amiibo series. - content: - application/json: - schema: - $ref: '#/components/schemas/TupleWrapper' + $ref: '#/components/responses/SuccessTuple' '400': - description: Bad Amiibo series request. + $ref: '#/components/responses/BadRequest' '404': - description: Amiibo series not found. + $ref: '#/components/responses/NotFound' '500': - description: Service currently not available. + $ref: '#/components/responses/Unavailable' parameters: - name: key in: query @@ -157,24 +161,21 @@ paths: schema: type: string style: form - /character: get: description: Get a list of all the game characters available in the database. operationId: getGameCharacters + tags: + - Game responses: '200': - description: Successful response returning the object that contains a list of game characters. - content: - application/json: - schema: - $ref: '#/components/schemas/TupleWrapper' + $ref: '#/components/responses/SuccessTuple' '400': - description: Bad game character request. + $ref: '#/components/responses/BadRequest' '404': - description: Game character not found. + $ref: '#/components/responses/NotFound' '500': - description: Service currently not available. + $ref: '#/components/responses/Unavailable' parameters: - name: key in: query @@ -190,24 +191,21 @@ paths: schema: type: string style: form - /gameseries: get: description: Gets a list of all the game series available in the database. operationId: getGameSeries + tags: + - Game responses: '200': - description: Successful response returning the object that contains a list of game series. - content: - application/json: - schema: - $ref: '#/components/schemas/TupleWrapper' + $ref: '#/components/responses/SuccessTuple' '400': - description: Bad game series request. + $ref: '#/components/responses/BadRequest' '404': - description: Game series not found. + $ref: '#/components/responses/NotFound' '500': - description: Service currently not available. + $ref: '#/components/responses/Unavailable' parameters: - name: key in: query @@ -223,24 +221,21 @@ paths: schema: type: string style: form - /type: get: description: Gets a list of all the Amiibo types available in the database. operationId: getAmiiboTypes + tags: + - Amiibo responses: '200': - description: Successful response returning the object that contains a list of Amiibo types. - content: - application/json: - schema: - $ref: '#/components/schemas/TupleWrapper' + $ref: '#/components/responses/SuccessTuple' '400': - description: Bad Amiibo type request. + $ref: '#/components/responses/BadRequest' '404': - description: Amiibo type not found. + $ref: '#/components/responses/NotFound' '500': - description: Service currently not available. + $ref: '#/components/responses/Unavailable' parameters: - name: key in: query @@ -256,11 +251,12 @@ paths: schema: type: string style: form - /lastupdated: get: description: Gets a timestamp when the Amiibo data was last updated. operationId: getLastUpdated + tags: + - Service responses: '200': description: Successful response returning the object that contains the date and time when the database was last updated. @@ -268,9 +264,43 @@ paths: application/json: schema: $ref: '#/components/schemas/LastUpdated' - + '400': + $ref: '#/components/responses/BadRequest' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/Unavailable' components: + responses: + BadRequest: + description: Response that indicates the service received a bad request. + content: + text/plain: + schema: + type: string + example: "Bad request" + NotFound: + description: Response that indicates the service cannot find a requested resource. + content: + text/plain: + schema: + type: string + example: "Not found" + SuccessTuple: + description: Response that returns a JSON object containing requested `Tuple` data from a resource. + content: + application/json: + schema: + $ref: '#/components/schemas/TupleWrapper' + Unavailable: + description: Response that indicates the service is unavailable to respond to requests. + content: + text/plain: + schema: + type: string + example: "Service unavailable" schemas: +# Core Entities Amiibo: type: object properties: @@ -299,7 +329,6 @@ components: name: type: string release: - type: object $ref: '#/components/schemas/AmiiboRelease' tail: type: string @@ -315,7 +344,6 @@ components: - release - tail - type - AmiiboGame: type: object properties: @@ -332,12 +360,10 @@ components: required: - gameID - gameName - AmiiboList: type: array items: $ref: '#/components/schemas/Amiibo' - AmiiboRelease: type: object properties: @@ -353,7 +379,6 @@ components: na: type: string format: date-time - AmiiboUsage: type: object properties: @@ -364,7 +389,15 @@ components: required: - Usage - write - + LastUpdated: + type: object + properties: + lastUpdated: + type: string + format: date-time + required: + - lastUpdated +# Wrapper Entities AmiiboWrapper: type: object properties: @@ -374,16 +407,6 @@ components: - $ref: '#/components/schemas/AmiiboList' required: - amiibo - - LastUpdated: - type: object - properties: - lastUpdated: - type: string - format: date-time - required: - - lastUpdated - Tuple: type: object properties: @@ -394,12 +417,10 @@ components: required: - key - name - TupleList: type: array items: $ref: '#/components/schemas/Tuple' - TupleWrapper: type: object properties: