java-json-tools/json-schema-core

Implement schema construction from JsonNode

dmak opened this issue · 0 comments

dmak commented

Would be nice if validation API is extended the way that schema can be constricted directly from JsonNode, for example, consider the following swagger snippet:

responses:
  "200":
    description: Successful operation
    content:
      application/json:
        schema:
          type: array
          items:
           $ref: "#/components/schemas/animalType"
        example:
          - type: human
            id: 5ebc32178718
            sex: male
          - type: animal
            id: ba5d08e1835b
            kind: dog

After Swagger is parsed, there should be an API method to validate JsonNode of example against JsonNode of schema.