... | @@ -8,7 +8,45 @@ Rotas existentes: |
... | @@ -8,7 +8,45 @@ Rotas existentes: |
|
|
|
|
|
- `GET` - /:flightiata
|
|
- `GET` - /:flightiata
|
|
|
|
|
|
exemplo de chamada: `https://us-central1-adapp-ages-2021-2.cloudfunctions.net/flightAPI/AD2933`
|
|
exemplo de chamada válida:
|
|
|
|
|
|
|
|
`https://us-central1-adapp-ages-2021-2.cloudfunctions.net/flightAPI/AD2933`
|
|
|
|
|
|
|
|
exemplo de output de chamada valida:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"flightIata": "AD2933",
|
|
|
|
"flightDate": "2021-10-05",
|
|
|
|
"flightStatus": "scheduled",
|
|
|
|
"departureAirport": "Afonso Pena International Airport",
|
|
|
|
"departureIata": "CWB",
|
|
|
|
"arrivalAirport": "Salgado Filho",
|
|
|
|
"arrivalIata": "POA",
|
|
|
|
"departureGate": "12",
|
|
|
|
"departureScheduleTime": "2021-10-05T17:25:00+00:00"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
exemplos de chamadas invalidas:
|
|
|
|
|
|
|
|
- flightiata não existe: `https://us-central1-adapp-ages-2021-2.cloudfunctions.net/flightAPI/AD1234`
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"errorCode": 1004,
|
|
|
|
"errorMessage": "Internal Server Error: TypeError: Cannot read property 'flight' of undefined"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
- flightiata não é do formato correto (6 caracteres): `https://us-central1-adapp-ages-2021-2.cloudfunctions.net/flightAPI/AD1234ASD`
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"errorCode": 1001,
|
|
|
|
"errorMessage": "Invalid flight number: \"value\" length must be 6 characters long"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
## Instruções
|
|
## Instruções
|
|
|
|
|
... | | ... | |