Skip to content
Snippets Groups Projects
Unverified Commit 199ecd35 authored by Adam Krídl's avatar Adam Krídl
Browse files

Add isSafeToCreateFlight operation into Rest API

parent 9bbe046b
No related branches found
No related tags found
No related merge requests found
......@@ -27,19 +27,80 @@ tags:
- name: Weather
description: Microservice for weather.
paths:
/api/isSafeToCreateFligth:
/api/isSafeToCreateFlight/{departureAirportId}/{arrivalAirportId}:
get:
tags:
- Weather
summary: Get recommendation about flight creation.
description: |
Returns an answer whether it is safe to create flight
(from the perspective of weather) based on four parameters.
Returns whether it is safe to create flight
(from the perspective of weather) based on four parameters
describing the flight to be created.
operationId: isSafeToCreateFlight
parameters:
- name: departureAirportId
in: path
required: true
schema:
type: integer
format: int64
- name: arrivalAirportId
in: path
required: true
schema:
type: integer
format: int64
- name: departureTime
in: query
required: true
schema:
type: string
description: time in ISO format
format: date-time
example: 2022-12-21T18:52:10.757Z
- name: arrivalTime
in: query
required: true
schema:
type: string
description: time in ISO format
format: date-time
example: 2022-12-21T18:52:10.757Z
responses:
"200":
description: OK
content:
application/json:
schema:
type: boolean
$ref: '#/components/schemas/FlightCreationAdvice'
"400":
description: Input data not correct
content:
application/json:
schema:
$ref: '../core/openapi.yaml#/components/schemas/ErrorMessage'
components:
schemas:
WeatherReason:
title: Weather reason
description: |
Enumeration of weather reasons, e.g. whether it is ok
to fly or the reason why not
type: string
example: ok-everything
enum:
- ok-everything
- nok-wind
- nok-temperature
- nok-rain
FlightCreationAdvice:
title: Flight creation advice
description: |
Response of '/api/isSafeToCreateFlight' call.
type: object
properties:
result:
type: boolean
description: Result whether it's safe to create such a flight
reason:
$ref: '#/components/schemas/WeatherReason'
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