Skip to content

Commit

Permalink
Error code documentation (#251)
Browse files Browse the repository at this point in the history
* RM21900: add documentation + several fixes.

* RM21900: change error message description as it is not always in the selected language

* RM21900: add 400 error codes.

* RM21900: add 5xx error documentation.

* RM21900: add X-TripGo-ErrorCode documentation.
  • Loading branch information
damianVarela authored Jul 25, 2024
1 parent 822b168 commit 0227a45
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 96 deletions.
70 changes: 35 additions & 35 deletions docs/specs/modules/booking.definitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ BookingsCountResponse:
BookingsResponse:
properties:
bookings:
$ref: '/specs/modules/booking.definitions.yaml#/ConfirmedBookingData'
$ref: '#/ConfirmedBookingData'
count:
type: number

ConfirmedBookingData:
properties:
confirmation:
$ref: '/specs/modules/booking.definitions.yaml#/LocalizedBookingConfirmationInfo'
$ref: '#/LocalizedBookingConfirmationInfo'
trips:
type: array
items:
Expand All @@ -28,17 +28,17 @@ ConfirmedBookingData:
LocalizedBookingConfirmationInfo:
properties:
provider:
$ref: '/specs/modules/booking.definitions.yaml#/Detail'
$ref: '#/Detail'
vehicle:
$ref: '/specs/modules/booking.definitions.yaml#/Detail'
$ref: '#/Detail'
status:
$ref: '/specs/modules/booking.definitions.yaml#/Detail'
$ref: '#/Detail'
purchase:
$ref: '/specs/modules/booking.definitions.yaml#/Purchase'
$ref: '#/Purchase'
actions:
type: array
items:
$ref: '/specs/modules/booking.definitions.yaml#/Action'
$ref: '#/Action'

Detail:
properties:
Expand Down Expand Up @@ -75,9 +75,9 @@ Purchase:
valid:
type: boolean
brand:
$ref: '/specs/tripgo.swagger.yaml#/definitions/CompanyInfo'
$ref: '../tripgo.swagger.yaml#/definitions/CompanyInfo'
source:
$ref: '/specs/tripgo.swagger.yaml#/definitions/DataSourceAttribution'
$ref: '../tripgo.swagger.yaml#/definitions/DataSourceAttribution'

Action:
properties:
Expand Down Expand Up @@ -106,7 +106,7 @@ Action:
description: "if present, the internalURL requires a POST with a JSON object with a field named 'input' and a list of objects with the exact format of these ones, but having the value field completed as expected"
type: array
items:
$ref: '/specs/modules/booking.definitions.yaml#/ActionInput'
$ref: '#/ActionInput'

ActionInput:
properties:
Expand Down Expand Up @@ -140,7 +140,7 @@ AuthData:
modeIdentifier:
type: string
companyInfo:
$ref: '/specs/tripgo.swagger.yaml#/definitions/CompanyInfo'
$ref: '../tripgo.swagger.yaml#/definitions/CompanyInfo'

BookingAction:
type: object
Expand All @@ -167,14 +167,14 @@ BookingAction:
BookingForm:
properties:
action:
$ref: '/specs/modules/booking.definitions.yaml#/BookingAction'
$ref: '#/BookingAction'
prevAction:
$ref: '/specs/modules/booking.definitions.yaml#/BookingAction'
$ref: '#/BookingAction'
form:
description: The list of FormGroups to show in the form.
type: array
items:
$ref: '/specs/modules/booking.definitions.yaml#/FormGroup'
$ref: '#/FormGroup'
image:
description: 'a URL of an image to show, whenever available'
type: string
Expand All @@ -200,25 +200,25 @@ BookingForm:
PaymentForm:
allOf:
- $ref: '/specs/modules/booking.definitions.yaml#/BookingForm'
- $ref: '#/BookingForm'
- type: object
description: Generic data to generate input fields on a payment booking screen

AuthForm:
allOf:
- $ref: '/specs/modules/booking.definitions.yaml#/BookingForm'
- $ref: '#/BookingForm'
- type: object
description: Generic data to generate input fields on an auth booking screen

BookingFormField:
allOf:
- $ref: '/specs/modules/booking.definitions.yaml#/FormField'
- $ref: '#/FormField'
- type: object
- properties:
action:
$ref: '/specs/modules/booking.definitions.yaml#/BookingAction'
$ref: '#/BookingAction'
prevAction:
$ref: '/specs/modules/booking.definitions.yaml#/BookingAction'
$ref: '#/BookingAction'
form:
description: The list of FormGroups to show in the form, not described properly on purpose to avoid infinite loop
type: array
Expand Down Expand Up @@ -248,7 +248,7 @@ BookingFormData:
description: ''
type: array
items:
$ref: '/specs/modules/booking.definitions.yaml#/FormField'
$ref: '#/FormField'
description: ''

FormField:
Expand Down Expand Up @@ -304,7 +304,7 @@ FormField:
StringFormField:
allOf:
- $ref: '/specs/modules/booking.definitions.yaml#/FormField'
- $ref: '#/FormField'
- type: object
- properties:
value:
Expand All @@ -324,16 +324,16 @@ StringFormField:

AddressFormField:
allOf:
- $ref: '/specs/modules/booking.definitions.yaml#/FormField'
- $ref: '#/FormField'
- type: object
- properties:
value:
description: 'value of the field, to be shown and filled/updated by the user, and sent to the backend if required'
$ref: '/specs/modules/booking.definitions.yaml#/Location'
$ref: '../tripgo.swagger.yaml#/definitions/Location'

DateTimeFormField:
allOf:
- $ref: '/specs/modules/booking.definitions.yaml#/FormField'
- $ref: '#/FormField'
- type: object
- properties:
value:
Expand All @@ -344,7 +344,7 @@ DateTimeFormField:

StepperFormField:
allOf:
- $ref: '/specs/modules/booking.definitions.yaml#/FormField'
- $ref: '#/FormField'
- type: object
- properties:
value:
Expand All @@ -359,7 +359,7 @@ StepperFormField:

TimeFormField:
allOf:
- $ref: '/specs/modules/booking.definitions.yaml#/FormField'
- $ref: '#/FormField'
- type: object
- properties:
value:
Expand All @@ -368,7 +368,7 @@ TimeFormField:

PasswordFormField:
allOf:
- $ref: '/specs/modules/booking.definitions.yaml#/FormField'
- $ref: '#/FormField'
- type: object
- properties:
value:
Expand All @@ -377,7 +377,7 @@ PasswordFormField:

LinkFormField:
allOf:
- $ref: '/specs/modules/booking.definitions.yaml#/FormField'
- $ref: '#/FormField'
- type: object
- properties:
value:
Expand All @@ -393,7 +393,7 @@ LinkFormField:

TextFormField:
allOf:
- $ref: '/specs/modules/booking.definitions.yaml#/FormField'
- $ref: '#/FormField'
- type: object
- properties:
value:
Expand All @@ -402,7 +402,7 @@ TextFormField:

SwitchFormField:
allOf:
- $ref: '/specs/modules/booking.definitions.yaml#/FormField'
- $ref: '#/FormField'
- type: object
- properties:
value:
Expand All @@ -411,16 +411,16 @@ SwitchFormField:

OptionFormField:
allOf:
- $ref: '/specs/modules/booking.definitions.yaml#/FormField'
- $ref: '#/FormField'
- type: object
- properties:
value:
description: 'value of the field, to be shown and filled/updated by the user, and sent to the backend if required'
$ref: '/specs/modules/booking.definitions.yaml#/OptionData'
$ref: '#/OptionData'
allValues:
description: 'list of available values to show to the user'
items:
$ref: '/specs/modules/booking.definitions.yaml#/OptionData'
$ref: '#/OptionData'

OptionData:
properties:
Expand All @@ -439,7 +439,7 @@ OptionData:

ExternalFormField:
allOf:
- $ref: '/specs/modules/booking.definitions.yaml#/FormField'
- $ref: '#/FormField'
- type: object
- properties:
value:
Expand All @@ -461,7 +461,7 @@ FormGroup:
description: ''
type: array
items:
$ref: '/specs/modules/booking.definitions.yaml#/FormField'
$ref: '#/FormField'
footer:
description: ''
type: string
Expand Down
Loading

0 comments on commit 0227a45

Please sign in to comment.