Skip to content
Snippets Groups Projects
Commit 27169272 authored by Martin Slovík's avatar Martin Slovík
Browse files

Implementing AirportDto, CityDto, GPSLocationDto, CountryDto

parent 0390b666
No related branches found
No related tags found
No related merge requests found
...@@ -69,7 +69,6 @@ paths: ...@@ -69,7 +69,6 @@ paths:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ErrorMessage' $ref: '#/components/schemas/ErrorMessage'
/api/stewards/{id}: /api/stewards/{id}:
get: get:
tags: tags:
...@@ -116,6 +115,36 @@ paths: ...@@ -116,6 +115,36 @@ paths:
$ref: '#/components/schemas/ErrorMessage' $ref: '#/components/schemas/ErrorMessage'
'401': '401':
description: unauthorized description: unauthorized
put:
tags:
- Steward
summary: Update steward by id
operationId: updateSteward
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
description: |
Receives data both in request body and as URL parameter and updates a steward by id.
Returns the updated steward as response.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/StewardDto'
required: true
responses:
"201":
$ref: '#/components/responses/SingleStewardDtoResponse'
"400":
description: input data were not correct
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
/api/stewards/paged: /api/stewards/paged:
get: get:
tags: tags:
...@@ -315,7 +344,7 @@ components: ...@@ -315,7 +344,7 @@ components:
- $ref: '#/components/schemas/DomainEntity' - $ref: '#/components/schemas/DomainEntity'
type: object type: object
title: airplane title: airplane
description: represents airplane description: represents an airplane
required: required:
- id - id
- name - name
...@@ -395,6 +424,91 @@ components: ...@@ -395,6 +424,91 @@ components:
$ref: '#/components/schemas/PageableObject' $ref: '#/components/schemas/PageableObject'
empty: empty:
type: boolean type: boolean
CountryDto:
allOf:
- $ref: '#/components/schemas/DomainEntity'
type: object
title: country
description: represents a country
required:
- id
- name
properties:
name:
type: string
description: country name
example: Canada, France, ...
CityDto:
allOf:
- $ref: '#/components/schemas/DomainEntity'
type: object
title: city
description: represents a city in a country containing airports
required:
- id
- name
properties:
name:
type: string
description: city name
example: New York, London
country:
$ref: '#/components/schemas/CountryDto'
airports:
type: array
items:
$ref: '#/components/schemas/AirplaneDto'
GPSLocationDto:
type: object
title: GPS location
description: represents a GPS location of latitude and longitude
required:
- latitude
- longitude
properties:
latitude:
type: number
format: double
example: 41.40338
longitude:
type: number
format: double
example: 2.17403
AirportDto:
allOf:
- $ref: '#/components/schemas/DomainEntity'
type: object
title: airport
description: represents an airport
required:
- id
- name
- code
- departingFlights
- arrivingFlights
- city
- location
properties:
name:
type: string
description: airport name
example: John F. Kennedy International Airport, Charles de Gaulle International Airport, ...
code:
type: string
description: airport code in IATA format
example: JFK, CDG, ...
departingFlights:
type: array
items:
$ref: '#/components/schemas/FlightDto'
arrivingFlights:
type: array
items:
$ref: '#/components/schemas/FlightDto'
city:
$ref: '#/components/schemas/CityDto'
location:
$ref: '#/components/schemas/GPSLocationDto'
responses: responses:
SingleStewardDtoResponse: SingleStewardDtoResponse:
description: response containing a single steward description: response containing a single steward
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment