oneOf in Swagger schema does not work

oneOf is supported in OpenAPI version 3 (openapi: 3.0.0), but not in Swagger version 2 (swagger: ‘2.0’). PaymentMethod: oneOf: – $ref: ‘#/components/schemas/NewPaymentMethod’ – $ref: ‘#/components/schemas/ExistPaymentMethod’ GitHub issue ref: https://github.com/OAI/OpenAPI-Specification/issues/333 For a list of changes in OpenAPI 3.0 compared to 2.0, see: https://blog.readme.io/an-example-filled-guide-to-swagger-3-2/

Generate Json schema from XML schema (XSD) [closed]

Disclaimer: I am the author of Jsonix, a powerful open-source XML<->JSON JavaScript mapping library. Today I’ve released the new version of the Jsonix Schema Compiler, with the new JSON Schema generation feature. Let’s take the Purchase Order schema for example. Here’s a fragment: <xsd:element name=”purchaseOrder” type=”PurchaseOrderType”/> <xsd:complexType name=”PurchaseOrderType”> <xsd:sequence> <xsd:element name=”shipTo” type=”USAddress”/> <xsd:element name=”billTo” type=”USAddress”/> … Read more

How do I validate incoming JSON data inside a REST service?

I searched for the best practice to enforce validation for incoming json data into a RESTful service. My suggestion is to use a MessageBodyReader which performs the validation inside the readFrom method. Below there is an message-body-reader example which is non-generic for the sake of simplicity. I also was interesed in finding the best framework … Read more