We are implementing Sabre REST API to access air, hotel and vehicle content in our C# ASP.NET MVC application.
So far we have hit some issues when generating C# model classes from the JSON Schema documents provided by Sabre Dev Studio. We are using Quicktype CLI (https://quicktype.io/) to generate the model classes.
Steps we have followed so far:
- Downloaded
OTA_AirLowFareSearchRQ.jsonschema
andOTA_AirLowFareSearchRS.jsonschema
files into a folder. - Using PowerShell navigated to the folder and invoke
quicktype -s schema OTA_AirLowFareSearchRQ.jsonschema OTA_AirLowFareSearchRS.jsonschema -o SabreAirLowFareSearch.cs
Unfortunately it fails with the message "Error: Trying to make an empty union - do you have an impossible type in your schema?". This appears to be isolated to OTA_AirLowFareSearchRQ.jsonschema
.
Is there a tool or best practice to successfully generate C# model classes from the JSON Schema documents?