Validation requires one more wrapping when "allOf" used twice

Issue #372 new
Former user created an issue

Hi,

I have schema like this:

openapi: 3.0.3
...
    SampleRequest:
      type: object
      description: Problematic request.
      allOf:
        - properties:
            animals:
              description: "All animals."
              allOf:
                - $ref: "#/components/schemas/Animals"
            birds:
              $ref: "#/components/schemas/Birds"
        - $ref: "#/components/schemas/People" 
    Animals:
      type: string
    Birds:
      type: string
    People
      type: object
      properties:
        man:
          type: string

Swagger io provides JSON request like this:

{
    "animals": "Dog",
    "birds": "Sparrow",
    "man": "me"
 }

But the validator (using version 2.20.0) refuse such Json and passes only with the JSON like this:

{
    "animals": {
      "animals": "Dog"
    },
    "birds": "Sparrow",
    "man": "me"
 }

Is there a possibility to configure the validator so that the fist version would pass?

Comments (0)

  1. Log in to comment