Skip to content

Schema Validation

The JSON Schema is a specification for defining the structure of JSON data i.e. JSON request body and response in case of REST APIs. Basically, JSON schema defines various keys and their values and certain constraints on the values.

The various important keywords that are used in the JSON schema are as given below:

  • Type: The type keyword defines the first constraint on our JSON data. Type can be null, boolean, object, array, number, integer, or string.
  • DateTime: Date and Time format validation.
  • Properties: The value of properties is an object, where each key is the name of a property and each value is a JSON schema used to validate that property.
  • Required: This keeps a list of required properties i.e the mandatory properties.
  • Minimum: Represents the minimum acceptable value for a number type property.
  • Maximum: Represents the maximum acceptable value for a number type property.
  • Max Items: The maximum number of items in an array type property.
  • Min Items: The minimum number of items in an array type property.
  • Max Length: Represents the maximum length for a string type property.
  • Min Length: Represents the minimum length for a string type property.
  • Pattern: A string instance is considered valid if the regular expression matches the instance successfully.
  • Additional Properties: Used to handle properties whose names are not listed in the properties' keyword.
Name Acceptable values Description
Date 2022-10-23 Format is YYYY-MM-DD
Time 09:54:59 Format is hh:mm:ss
Date Time 2022-10-23T09:54:59 Format is YYYY-MM-DDThh:mm:ss
DateTime WithTimeZone 2022-10-23T09:54:59+14:00[Pacific/Kiritimati] Format is YYYY-MM-DDThh:mm:ssTZD
Time Duration 1D2H10M It can consists of days,hours and minutes
1D5H20M.
If duration is less than 24h then format is like 5H20M. If duration is less than 24h then Day component will not be available.
Airport Code DXB Max length is 3. All letters should be capital and English alphabet letters.
Airline Code BA Max length is 2. All letters should be alphanumeric characters.
Country Code USA Max length is 3. All letters should be capital and English alphabet letters.
Country Name INDIA All letters should be in English alphabet letters. Numbers are not allowed.
City Name Mumbai All letters should be in English alphabet letters. Numbers are not allowed.
City Code BOM Max length is 3. All letters should be capital and English alphabet letters.
Currency EUR Max length is 3. All letters should be capital and English alphabet letters.
Culture en Max length is 2. All letters should be simple English alphabet letters.
Cabin Class 1,2 All values should be belongs to ;
1 = First, 2 = Business, 4 = Premium Economy and 5 = Economy
Booking Class V,VA,A1 Max length is 3. The letter should be English alphabet letters. The numbers should be between 0-9.
Pax Type ADT All values should be belongs to ; ADT,CHD,INF
Pax Age 10 Value should be greater than 0.
Gender M,F All values should be belongs to ; M,F
Telephone Number 2087385301 All values should be numbers, The min length is 8 and max length is 15.
Area Code 44 All values should be numbers, The min length is 2 and max length is 5.
Email address contact.us@verchaska.com Value should be with standard email format.
Pax Title Mr All values should be belongs to ;
"Mrs", "Mr", "Mstr", "Inf", "Inf", "Miss", "Miss", "Mstr", "Miss", "Prof", "Capt", "Dr", "Prof", "Capt", "Dr"
Request Mandatory Fields departureAirportCode* All required fields will be validated. All Mandatory fields are highlighted as this in the document.
Response Mandatory Fields city* All Mandatory fields are highlighted as this in all responses. So then client integration, all optional attributes and list should be handle with their implementation.
Not released yet attributes If client is passing not released attributes with request then it will be given as warning in the response.Anyway it will not block the flow. In the API documentation, all not implemented attributes are mentioned as given below.
Not released yet
These options will be released with future API version.
UUID format ConversationId This will allow only below charters.
a75f2ed1-00cd-4d85-aeff-4f0ba97ddaa2