Skip to content

Commit

Permalink
Merge pull request #1 from trivago/feature/MAPS-298-use-official-schemas
Browse files Browse the repository at this point in the history
Feature/maps 298 use official schemas
  • Loading branch information
Ahmed Abodeif authored Aug 4, 2020
2 parents 319c767 + 26985c9 commit bc9464e
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 38 deletions.
69 changes: 51 additions & 18 deletions open-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,19 +331,22 @@
},
"terms_and_conditions": {
"description": "General terms and conditions.\nText field.\nLength limit of 1000 characters.",
"type": "string"
"type": "string",
"maxLength": 1000
},
"terms_and_conditions_url": {
"description": "Link to the advertiser's terms and conditions page.",
"type": "string"
},
"payment_policy": {
"description": "Describes how the advertiser will use the credit card information, e.g. charged immediately or hold.\nText field.\nLength limit of 1000 characters.",
"type": "string"
"type": "string",
"maxLength": 1000
},
"other_policy": {
"description": "Miscellaneous policies\nText field.\nLength limit of 1000 characters.",
"type": "string"
"type": "string",
"maxLength": 1000
},
"errors": {
"description": "Array of errors",
Expand Down Expand Up @@ -1012,7 +1015,13 @@
},
"type": {
"description": "Specifies the penalty users have to pay at time of booking. Must be of one of the following strings :\n- unknown\n- full_refundable\n- partial_refundable\n- non_refundable",
"type": "string"
"type": "string",
"enum": [
"unknown",
"full_refundable",
"partial_refundable",
"non_refundable"
]
}
},
"type": "object"
Expand Down Expand Up @@ -1135,7 +1144,7 @@
"percentage": {
"description": "Percentage value of the discount. Mandatory, only if total is not provided.",
"type": "number",
"format": "float"
"format": "number"
},
"total": {
"$ref": "#/components/schemas/price"
Expand Down Expand Up @@ -1168,7 +1177,8 @@
},
"message": {
"description": "String describing the error (maximum length of 1000 characters).",
"type": "string"
"type": "string",
"maxLength": 1000
},
"timeout": {
"description": "Number of seconds trivago should stop sending requests (for use with Error Code 4).",
Expand Down Expand Up @@ -1253,12 +1263,12 @@
"latitude": {
"description": "Latitude coordinate",
"type": "number",
"format": "float"
"format": "number"
},
"longitude": {
"description": "Longitude coordinate",
"type": "number",
"format": "float"
"format": "number"
},
"url": {
"description": "URL for general hotel contact",
Expand Down Expand Up @@ -1943,7 +1953,7 @@
"interest_charge": {
"description": "Interest rate per installment",
"type": "number",
"format": "float"
"format": "number"
},
"extra_charge": {
"$ref": "#/components/schemas/price"
Expand Down Expand Up @@ -2058,7 +2068,7 @@
"amount": {
"description": "The value of the price.",
"type": "number",
"format": "float"
"format": "number"
},
"currency": {
"description": "ISO 4217 currency code for the price.",
Expand Down Expand Up @@ -2320,15 +2330,33 @@
"properties": {
"name": {
"description": "Short description of the room type. This will be displayed to users, and should be in the language indicated by\nthe 'lang' parameter (max length of 120 characters).",
"type": "string"
"type": "string",
"maxLength": 120
},
"rate_key": {
"description": "Unique identifier for this rate. Used to identify a rate across several \"/booking_availability\" requests. E.g.\nif an user stays on the landing page for a longer period of time before clicking on a specific rate another\n\"/booking_availability\" request is submitted to ensure that the rate clicked is still bookable.\nIf no rate_key is provided a rate is identified based on rate attributes and rate components.",
"type": "string"
},
"room_type": {
"description": "Must be one of:\n- STANDARD\n- COMFORT\n- FAMILY\n- DELUXE\n- SUPERIOR\n- EXECUTIVE\n- JUNIOR_SUITE\n- SUITE\n- EXECUTIVE_SUITE\n- STUDIO\n- APARTMENT\n- BUNGALOW\n- VILLA\n- SHARED\n- OTHERS\nIf room_type field is not provided, room_group.name is used. If room_group.name is missing as well, the field \"name\" of the RoomType object is used.",
"type": "string"
"type": "string",
"enum": [
"STANDARD",
"COMFORT",
"FAMILY",
"DELUXE",
"SUPERIOR",
"EXECUTIVE",
"JUNIOR_SUITE",
"SUITE",
"EXECUTIVE_SUITE",
"STUDIO",
"APARTMENT",
"BUNGALOW",
"VILLA",
"SHARED",
"OTHERS"
]
},
"room_group": {
"description": "An identifier, which groups different rates to a specified room. All elements with the same room_group.code relates to the same real room (physical).",
Expand All @@ -2348,7 +2376,8 @@
},
"description": {
"description": "Longer room description. Will be displayed to users, and should be in the language indicated by the 'lang' parameter (max length of 1000 characters).",
"type": "string"
"type": "string",
"maxLength": 1000
},
"rooms_available": {
"description": "The number of rooms remaining/available.",
Expand Down Expand Up @@ -2425,7 +2454,7 @@
"cancellation_policy": {
"description": "Text describing the cancellation policy for the room. Should be in the language indicated by the 'lang'\nparameter. Text field.Length limit: 1000 characters.",
"type": "string",
"nullable": true,
"maxLength": 1000,
"deprecated": true
},
"cancellation_deadline": {
Expand All @@ -2436,15 +2465,18 @@
},
"occupancy_policy": {
"description": "Occupancy policies for this room e.g. maximum number of adults, minimum ages.Text field.Length\nlimit: 1000 characters.",
"type": "string"
"type": "string",
"maxLength": 1000
},
"payment_policy": {
"description": "Describes how the advertiser will use the credit card information, e.g. charged immediately or hold.\n(Length limit: 1000 characters).",
"type": "string"
"type": "string",
"maxLength": 1000
},
"other_policy": {
"description": "Miscellaneous policies.Text field (Length limit: 1000 characters).",
"type": "string"
"type": "string",
"maxLength": 1000
},
"promotions": {
"description": "Array of promotions",
Expand Down Expand Up @@ -2508,7 +2540,8 @@
},
"description": {
"description": "Description of the real room limited to 1000 characters.",
"type": "string"
"type": "string",
"maxLength": 1000
}
},
"type": "object"
Expand Down
9 changes: 6 additions & 3 deletions schemas/booking-availability-response-success.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,22 @@
},
"terms_and_conditions": {
"description": "General terms and conditions.\nText field.\nLength limit of 1000 characters.",
"type": "string"
"type": "string",
"maxLength": 1000
},
"terms_and_conditions_url": {
"description": "Link to the advertiser's terms and conditions page.",
"type": "string"
},
"payment_policy": {
"description": "Describes how the advertiser will use the credit card information, e.g. charged immediately or hold.\nText field.\nLength limit of 1000 characters.",
"type": "string"
"type": "string",
"maxLength": 1000
},
"other_policy": {
"description": "Miscellaneous policies\nText field.\nLength limit of 1000 characters.",
"type": "string"
"type": "string",
"maxLength": 1000
},
"errors": {
"description": "Array of errors",
Expand Down
8 changes: 7 additions & 1 deletion schemas/cancellation.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
},
"type": {
"description": "Specifies the penalty users have to pay at time of booking. Must be of one of the following strings :\n- unknown\n- full_refundable\n- partial_refundable\n- non_refundable",
"type": "string"
"type": "string",
"enum": [
"unknown",
"full_refundable",
"partial_refundable",
"non_refundable"
]
}
},
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schemas/discount.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"percentage": {
"description": "Percentage value of the discount. Mandatory, only if total is not provided.",
"type": "number",
"format": "float"
"format": "number"
},
"total": {
"$ref": "price.json"
Expand Down
3 changes: 2 additions & 1 deletion schemas/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
},
"message": {
"description": "String describing the error (maximum length of 1000 characters).",
"type": "string"
"type": "string",
"maxLength": 1000
},
"timeout": {
"description": "Number of seconds trivago should stop sending requests (for use with Error Code 4).",
Expand Down
7 changes: 4 additions & 3 deletions schemas/hotel-details.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
"latitude": {
"description": "Latitude coordinate",
"type": "number",
"format": "float"
"format": "number"
},
"longitude": {
"description": "Longitude coordinate",
"type": "number",
"format": "float"
"format": "number"
},
"url": {
"description": "URL for general hotel contact",
Expand All @@ -70,7 +70,8 @@
},
"checkinout_policy": {
"description": "Describes the check-in/check-out policy for the hotel. Should be in the language indicated by the 'lang'\nparameter. Max length 1000 characters.",
"type": "string"
"type": "string",
"maxLength": 1000
}
},
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schemas/installment.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"interest_charge": {
"description": "Interest rate per installment",
"type": "number",
"format": "float"
"format": "number"
},
"extra_charge": {
"$ref": "price.json"
Expand Down
2 changes: 1 addition & 1 deletion schemas/price.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"amount": {
"description": "The value of the price.",
"type": "number",
"format": "float"
"format": "number"
},
"currency": {
"description": "ISO 4217 currency code for the price.",
Expand Down
3 changes: 2 additions & 1 deletion schemas/room-group.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
},
"description": {
"description": "Description of the real room limited to 1000 characters.",
"type": "string"
"type": "string",
"maxLength": 1000
}
},
"type": "object",
Expand Down
38 changes: 30 additions & 8 deletions schemas/room-type.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,33 @@
"properties": {
"name": {
"description": "Short description of the room type. This will be displayed to users, and should be in the language indicated by\nthe 'lang' parameter (max length of 120 characters).",
"type": "string"
"type": "string",
"maxLength": 120
},
"rate_key": {
"description": "Unique identifier for this rate. Used to identify a rate across several \"/booking_availability\" requests. E.g.\nif an user stays on the landing page for a longer period of time before clicking on a specific rate another\n\"/booking_availability\" request is submitted to ensure that the rate clicked is still bookable.\nIf no rate_key is provided a rate is identified based on rate attributes and rate components.",
"type": "string"
},
"room_type": {
"description": "Must be one of:\n- STANDARD\n- COMFORT\n- FAMILY\n- DELUXE\n- SUPERIOR\n- EXECUTIVE\n- JUNIOR_SUITE\n- SUITE\n- EXECUTIVE_SUITE\n- STUDIO\n- APARTMENT\n- BUNGALOW\n- VILLA\n- SHARED\n- OTHERS\nIf room_type field is not provided, room_group.name is used. If room_group.name is missing as well, the field \"name\" of the RoomType object is used.",
"type": "string"
"type": "string",
"enum": [
"STANDARD",
"COMFORT",
"FAMILY",
"DELUXE",
"SUPERIOR",
"EXECUTIVE",
"JUNIOR_SUITE",
"SUITE",
"EXECUTIVE_SUITE",
"STUDIO",
"APARTMENT",
"BUNGALOW",
"VILLA",
"SHARED",
"OTHERS"
]
},
"room_group": {
"description": "An identifier, which groups different rates to a specified room. All elements with the same room_group.code relates to the same real room (physical).",
Expand All @@ -40,7 +58,8 @@
},
"description": {
"description": "Longer room description. Will be displayed to users, and should be in the language indicated by the 'lang' parameter (max length of 1000 characters).",
"type": "string"
"type": "string",
"maxLength": 1000
},
"rooms_available": {
"description": "The number of rooms remaining/available.",
Expand Down Expand Up @@ -117,8 +136,8 @@
"cancellation_policy": {
"description": "Text describing the cancellation policy for the room. Should be in the language indicated by the 'lang'\nparameter. Text field.Length limit: 1000 characters.",
"type": "string",
"nullable": true,
"deprecated": true
"deprecated": true,
"maxLength": 1000
},
"cancellation_deadline": {
"description": "The datetime after which it is not free to cancel a reservation.The format must match YYYY-MM-DDThh:mm:ss. Note\nthere is no timezone info because it's localized to the property.\nExample: \"cancellation_deadline\": \"2015-05-25T16:00:00\"",
Expand All @@ -128,15 +147,18 @@
},
"occupancy_policy": {
"description": "Occupancy policies for this room e.g. maximum number of adults, minimum ages.Text field.Length\nlimit: 1000 characters.",
"type": "string"
"type": "string",
"maxLength": 1000
},
"payment_policy": {
"description": "Describes how the advertiser will use the credit card information, e.g. charged immediately or hold.\n(Length limit: 1000 characters).",
"type": "string"
"type": "string",
"maxLength": 1000
},
"other_policy": {
"description": "Miscellaneous policies.Text field (Length limit: 1000 characters).",
"type": "string"
"type": "string",
"maxLength": 1000
},
"promotions": {
"description": "Array of promotions",
Expand Down

0 comments on commit bc9464e

Please sign in to comment.