From 44fccf17657660c9e08afefd1cfc523dac8fc444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl?= Date: Fri, 16 Feb 2024 17:06:42 +0100 Subject: [PATCH] Airline Code Lookup OAS3 correction --- ...neCodeLookUp_v1_swagger_specification.json | 515 ++++++++++-------- ...neCodeLookUp_v1_swagger_specification.yaml | 128 +++-- 2 files changed, 374 insertions(+), 269 deletions(-) diff --git a/spec/json/AirlineCodeLookUp_v1_swagger_specification.json b/spec/json/AirlineCodeLookUp_v1_swagger_specification.json index 266eeea..ef7240b 100644 --- a/spec/json/AirlineCodeLookUp_v1_swagger_specification.json +++ b/spec/json/AirlineCodeLookUp_v1_swagger_specification.json @@ -1,13 +1,17 @@ { - "swagger": "2.0", + "openapi": "3.0.1", "info": { - "version": "1.1.1", "title": "Airline Code Lookup API", + "description": "Before using this API, we recommend you read our\n**[Authorization Guide](https://developers.amadeus.com/self-service/apis-docs/guides/authorization-262)**\nfor more information on how to generate an access token.\n\nPlease also be aware that our test environment is based on a subset of the production,\nto see what is included in test please refer to our **[data collection](https://github.com/amadeus4dev/data-collection)**.\n", + "version": "1.2.1", "x-status": "validated", "x-tags": [ "#ama-for-dev" ], "x-release-note": { + "1.2.0": [ + "Migration to OAS3" + ], "1.1.0": [ "Correct example", "Regroup parameter \"IATACode\" and \"ICAOCode\" under the same name \"airlineCodes\"" @@ -17,19 +21,12 @@ "List all airlines information (name and code)", "Introduction of search per IATA or ICAO code" ] - }, - "description": "\nBefore using this API, we recommend you read our **[Authorization Guide](https://developers.amadeus.com/self-service/apis-docs/guides/authorization-262)** for more information on how to generate an access token. \n\nPlease also be aware that our test environment is based on a subset of the production, to see what is included in test please refer to our **[data collection](https://github.com/amadeus4dev/data-collection)**." + } }, - "host": "test.api.amadeus.com", - "basePath": "/v1", - "schemes": [ - "https" - ], - "consumes": [ - "application/vnd.amadeus+json" - ], - "produces": [ - "application/vnd.amadeus+json" + "servers": [ + { + "url": "https://test.api.amadeus.com/v1" + } ], "paths": { "/reference-data/airlines": { @@ -37,257 +34,327 @@ "tags": [ "airlines" ], - "operationId": "getairlines", "summary": "Return airlines information.", + "operationId": "getairlines", "parameters": [ { "name": "airlineCodes", - "description": "Code of the airline following IATA standard([IATA table codes](http://www.iata.org/publications/Pages/code-search.aspx)) or ICAO standard ([ICAO airlines table codes](https://en.wikipedia.org/wiki/List_of_airline_codes))\n\nSeveral airlines can be selected at once by sending a list separated by a coma (i.e. AF, SWA)\n", "in": "query", - "required": false, - "type": "string", - "x-example": "BA" + "description": "Code of the airline following IATA standard([IATA table codes](http://www.iata.org/publications/Pages/code-search.aspx)) or ICAO standard ([ICAO airlines table codes](https://en.wikipedia.org/wiki/List_of_airline_codes))\n\nSeveral airlines can be selected at once by sending a list separated by a coma (i.e. AF, SWA)\n", + "schema": { + "type": "string" + }, + "examples": { + "BA": { + "value": "BA" + } + } } ], "responses": { "200": { - "$ref": "#/responses/airlines" + "$ref": "#/components/responses/airlines" }, "400": { - "$ref": "#/responses/400" + "$ref": "#/components/responses/400" }, - "default": { - "$ref": "#/responses/500" + "500": { + "$ref": "#/components/responses/500" } - }, - "description": "" + } } } }, - "definitions": { - "Airline": { - "properties": { - "type": { - "description": "the resource name", - "type": "string", - "example": "airline" - }, - "iataCode": { - "description": "IATA airline code. see [IATA table codes](http://www.iata.org/publications/Pages/code-search.aspx)", - "type": "string", - "example": "WN" - }, - "icaoCode": { - "description": "IATA airline code. see [ICAO airlines table codes](https://en.wikipedia.org/wiki/List_of_airline_codes)", - "type": "string", - "example": "SWA" - }, - "businessName": { - "description": "airline business name", - "type": "string", - "example": "SOUTHWEST AIRLINES TEXAS" - }, - "commonName": { - "description": "airline common name", - "type": "string", - "example": "SW AIRLINES" - } - } - }, - "Error_400": { - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/definitions/Issue" - } + "components": { + "examples": { + "INVALID_FORMAT": { + "value": { + "errors": [ + { + "status": 400, + "code": 477, + "title": "INVALID FORMAT", + "detail": "invalid query parameter format", + "source": { + "parameter": "airlineCodes", + "example": "BA" + } + } + ] } }, - "required": [ - "errors" - ], - "example": { - "errors": [ - { - "status": 400, - "code": 477, - "title": "INVALID FORMAT", - "detail": "invalid query parameter format", - "source": { - "parameter": "airport", - "example": "CDG" + "SYSTEM_ERROR": { + "value": { + "errors": [ + { + "status": 500, + "code": 141, + "title": "SYSTEM ERROR HAS OCCURRED" } - } - ] + ] + } } }, - "Error_500": { - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/definitions/Issue" + "schemas": { + "Warning": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "description": "an application-specific error code", + "format": "int64" + }, + "title": { + "type": "string", + "description": "a short summary of the error" + }, + "detail": { + "type": "string", + "description": "explanation of the error" + }, + "source": { + "title": "Issue_Source", + "type": "object", + "properties": { + "pointer": { + "type": "string", + "description": "a JSON Pointer [RFC6901] to the associated entity in the request document" + }, + "parameter": { + "type": "string", + "description": "a string indicating which URI query parameter caused the issue" + }, + "example": { + "type": "string", + "description": "a string indicating an example of the right value" + } + }, + "description": "an object containing references to the source of the error" } } }, - "required": [ - "errors" - ], - "example": { - "errors": [ - { - "status": 500, - "code": 141, - "title": "SYSTEM ERROR HAS OCCURRED" + "Airline": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "the resource name", + "example": "airline" + }, + "iataCode": { + "type": "string", + "description": "IATA airline code. see [IATA table codes](http://www.iata.org/publications/Pages/code-search.aspx)", + "example": "WN" + }, + "icaoCode": { + "type": "string", + "description": "IATA airline code. see [ICAO airlines table codes](https://en.wikipedia.org/wiki/List_of_airline_codes)", + "example": "SWA" + }, + "businessName": { + "type": "string", + "description": "airline business name", + "example": "SOUTHWEST AIRLINES TEXAS" + }, + "commonName": { + "type": "string", + "description": "airline common name", + "example": "SW AIRLINES" } - ] - } - }, - "Issue": { - "properties": { - "status": { - "description": "the HTTP status code applicable to this error", - "type": "integer" - }, - "code": { - "description": "an application-specific error code", - "type": "integer", - "format": "int64" - }, - "title": { - "description": "a short summary of the error", - "type": "string" - }, - "detail": { - "description": "explanation of the error", - "type": "string" - }, - "source": { - "type": "object", - "title": "Issue_Source", - "description": "an object containing references to the source of the error", - "maxProperties": 1, - "properties": { - "pointer": { - "description": "a JSON Pointer [RFC6901] to the associated entity in the request document", - "type": "string" + } + }, + "Error": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "the HTTP status code applicable to this error" + }, + "code": { + "type": "integer", + "description": "an application-specific error code", + "format": "int64" + }, + "title": { + "type": "string", + "description": "a short summary of the error" + }, + "detail": { + "type": "string", + "description": "explanation of the error" + }, + "source": { + "title": "Issue_Source", + "type": "object", + "properties": { + "pointer": { + "type": "string", + "description": "a JSON Pointer [RFC6901] to the associated entity in the request document" + }, + "parameter": { + "type": "string", + "description": "a string indicating which URI query parameter caused the issue" + }, + "example": { + "type": "string", + "description": "a string indicating an example of the right value" + } }, - "parameter": { - "description": "a string indicating which URI query parameter caused the issue", - "type": "string" + "description": "an object containing references to the source of the error" + } + } + }, + "Meta": { + "title": "Meta", + "type": "object", + "properties": { + "count": { + "type": "integer", + "example": 1 + }, + "links": { + "title": "CollectionLinks", + "type": "object", + "properties": { + "self": { + "type": "string", + "format": "uri", + "example": "https://test.api.amadeus.com/v1/area/resources?..." + }, + "next": { + "type": "string", + "format": "uri", + "example": "https://test.api.amadeus.com/v1/area/resources?..." + }, + "previous": { + "type": "string", + "format": "uri", + "example": "https://test.api.amadeus.com/v1/area/resources?..." + }, + "last": { + "type": "string", + "format": "uri", + "example": "https://test.api.amadeus.com/v1/area/resources?..." + }, + "first": { + "type": "string", + "format": "uri", + "example": "https://test.api.amadeus.com/v1/area/resources?..." + }, + "up": { + "type": "string", + "format": "uri", + "example": "https://test.api.amadeus.com/v1/area/resources?..." + } }, "example": { - "description": "a string indicating an example of the right value", - "type": "string" + "self": "https://test.api.amadeus.com/v1/area/resources?param=value" } } } } }, - "Collection_Meta": { - "title": "Collection_Meta", - "properties": { - "count": { - "type": "integer", - "example": 1 - }, - "links": { - "title": "CollectionLinks", - "properties": { - "self": { - "type": "string", - "format": "uri", - "example": "https://test.api.amadeus.com/v1/area/resources?..." - }, - "next": { - "type": "string", - "format": "uri", - "example": "https://test.api.amadeus.com/v1/area/resources?..." - }, - "previous": { - "type": "string", - "format": "uri", - "example": "https://test.api.amadeus.com/v1/area/resources?..." + "responses": { + "airlines": { + "description": "Successful Operation", + "content": { + "application/vnd.amadeus+json": { + "schema": { + "title": "Airlines", + "required": [ + "data" + ], + "type": "object", + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta" + }, + "warnings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Warning" + } + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Airline" + } + } + } }, - "last": { - "type": "string", - "format": "uri", - "example": "https://test.api.amadeus.com/v1/area/resources?..." - }, - "first": { - "type": "string", - "format": "uri", - "example": "https://test.api.amadeus.com/v1/area/resources?..." - }, - "up": { - "type": "string", - "format": "uri", - "example": "https://test.api.amadeus.com/v1/area/resources?..." + "examples": { + "BA": { + "value": { + "meta": { + "count": 1, + "links": { + "self": "https://test.api.amadeus.com/v1/reference-data/airlines?airlineCodes=BA" + } + }, + "data": [ + { + "type": "airline", + "iataCode": "BA", + "icaoCode": "BAW", + "businessName": "BRITISH AIRWAYS", + "commonName": "BRITISH A/W" + } + ] + } + } } - }, - "example": { - "self": "https://test.api.amadeus.com/v1/area/resources?param=value" } } - } - } - }, - "responses": { - "400": { - "description": "code | title \n------- | ------------------------------------- \n 572 | INVALID OPTION \n", - "schema": { - "$ref": "#/definitions/Error_400" - } - }, - "500": { - "description": "Unexpected Error", - "schema": { - "$ref": "#/definitions/Error_500" - } - }, - "airlines": { - "description": "Successful Operation", - "schema": { - "title": "Success Things", - "required": [ - "data" - ], - "properties": { - "meta": { - "$ref": "#/definitions/Collection_Meta" - }, - "warnings": { - "type": "array", - "items": { - "$ref": "#/definitions/Issue" - } - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Airline" + }, + "400": { + "description": "| code | title |\n| ---- | -------------- |\n| 572 | INVALID OPTION |\n", + "content": { + "application/vnd.amadeus+json": { + "schema": { + "type": "object", + "title": "Errors", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "examples": { + "Invalid Format": { + "$ref": "#/components/examples/INVALID_FORMAT" + } } } - }, - "example": { - "meta": { - "count": 1, - "links": { - "self": "https://test.api.amadeus.com/v1/reference-data/airlines?airlineCodes=BA" - } - }, - "data": [ - { - "type": "airline", - "iataCode": "BA", - "icaoCode": "BAW", - "businessName": "BRITISH AIRWAYS", - "commonName": "BRITISH A/W" + } + }, + "500": { + "description": "Unexpected Error", + "content": { + "application/vnd.amadeus+json": { + "schema": { + "type": "object", + "title": "Errors", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "examples": { + "500": { + "$ref": "#/components/examples/SYSTEM_ERROR" + } } - ] + } } } } - }, - "x-generatedAt": "2020-07-16T07:57:31.414Z" + } } \ No newline at end of file diff --git a/spec/yaml/AirlineCodeLookUp_v1_swagger_specification.yaml b/spec/yaml/AirlineCodeLookUp_v1_swagger_specification.yaml index 903a125..053d2e3 100644 --- a/spec/yaml/AirlineCodeLookUp_v1_swagger_specification.yaml +++ b/spec/yaml/AirlineCodeLookUp_v1_swagger_specification.yaml @@ -8,11 +8,13 @@ info: Please also be aware that our test environment is based on a subset of the production, to see what is included in test please refer to our **[data collection](https://github.com/amadeus4dev/data-collection)**. - version: 1.1.1 + version: 1.2.1 x-status: validated x-tags: - '#ama-for-dev' x-release-note: + "1.2.0": + - Migration to OAS3 "1.1.0": - Correct example - Regroup parameter "IATACode" and "ICAOCode" under the same name "airlineCodes" @@ -38,46 +40,64 @@ paths: Several airlines can be selected at once by sending a list separated by a coma (i.e. AF, SWA) schema: type: string - example: BA + examples: + BA: + value: BA responses: 200: $ref: '#/components/responses/airlines' 400: $ref: '#/components/responses/400' - default: + 500: $ref: '#/components/responses/500' components: - schemas: - Error_400: - properties: - errors: - type: array - items: - $ref: '#/components/schemas/Issue' - required: - - errors - example: + examples: + INVALID_FORMAT: + value: errors: - status: 400 code: 477 title: INVALID FORMAT detail: invalid query parameter format source: - parameter: airport - example: CDG - Error_500: - properties: - errors: - type: array - items: - $ref: '#/components/schemas/Issue' - required: - - errors - example: + parameter: airlineCodes + example: BA + SYSTEM_ERROR: + value: errors: - status: 500 code: 141 title: SYSTEM ERROR HAS OCCURRED + schemas: + Warning: + type: object + properties: + code: + type: integer + description: an application-specific error code + format: int64 + title: + type: string + description: a short summary of the error + detail: + type: string + description: explanation of the error + source: + title: Issue_Source + type: object + properties: + pointer: + type: string + description: "a JSON Pointer [RFC6901] to the associated entity in the\ + \ request document" + parameter: + type: string + description: a string indicating which URI query parameter caused the + issue + example: + type: string + description: a string indicating an example of the right value + description: an object containing references to the source of the error Airline: type: object properties: @@ -101,7 +121,7 @@ components: type: string description: airline common name example: SW AIRLINES - Issue: + Error: type: object properties: status: @@ -133,8 +153,8 @@ components: type: string description: a string indicating an example of the right value description: an object containing references to the source of the error - Collection_Meta: - title: Collection_Meta + Meta: + title: Meta type: object properties: count: @@ -176,32 +196,34 @@ components: content: application/vnd.amadeus+json: schema: - title: Success Things + title: Airlines required: - data type: object properties: meta: - $ref: '#/components/schemas/Collection_Meta' + $ref: '#/components/schemas/Meta' warnings: type: array items: - $ref: '#/components/schemas/Issue' + $ref: '#/components/schemas/Warning' data: type: array items: $ref: '#/components/schemas/Airline' - example: - meta: - count: 1 - links: - self: https://test.api.amadeus.com/v1/reference-data/airlines?airlineCodes=BA - data: - - type: airline - iataCode: BA - icaoCode: BAW - businessName: BRITISH AIRWAYS - commonName: BRITISH A/W + examples: + BA: + value: + meta: + count: 1 + links: + self: https://test.api.amadeus.com/v1/reference-data/airlines?airlineCodes=BA + data: + - type: airline + iataCode: BA + icaoCode: BAW + businessName: BRITISH AIRWAYS + commonName: BRITISH A/W 400: description: | | code | title | @@ -210,12 +232,28 @@ components: content: application/vnd.amadeus+json: schema: - $ref: '#/components/schemas/Error_400' + type: object + title: Errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Error' + examples: + Invalid Format: + $ref: '#/components/examples/INVALID_FORMAT' 500: description: Unexpected Error content: application/vnd.amadeus+json: schema: - $ref: '#/components/schemas/Error_500' -x-generatedAt: 2020-07-16T07:57:31.414Z -x-original-swagger-version: "2.0" + type: object + title: Errors + properties: + errors: + type: array + items: + $ref: '#/components/schemas/Error' + examples: + 500: + $ref: '#/components/examples/SYSTEM_ERROR'