Contributions
- 2KViews0likes0Comments
Naming a property with a reserved keyword for name
Hi all, I need to write a contract to act as a schema for the rest messages which a legacy system sends. Unfortunately this system uses 'type' as the name of a property. A relevant snipped of the JSON is here: elements: [ { type: "radiogroup", name: "DentalQuestion2" } , { type: "checkbox", name: "DentalQuesiton3" } ] I am defining the schema (for the elements inside the array) like this: components: schemas: element: type: object properties: name: type: string #type here is the keyword type: #type here is the actual name of the property! type: string enum: - radiogroup - checkbox However it appears the SwaggerHub validator is telling me this is incorrect. Is there any way to override the 'type' keyword? Regards, JohnSolved2KViews0likes2Comments