openapi-core icon indicating copy to clipboard operation
openapi-core copied to clipboard

oneOf in array items not working

Open smarlowucf opened this issue 7 years ago • 0 comments

If you have multiple types (oneOf) of items in an array only the first is validated against:

schema

conditions:
  type: array
  items:
    oneOf:
      - type: object
        required:
          - image
        properties:
          image:
            type: string
        additionalProperties: false
      - type: object
        required:
          - package
        properties:
          package:
            type: array
            items:
              type: string
            minItems: 2

request

{'conditions': [{'image': 'data'}, {'package': ['info', 'data']}]}

Yields: openapi_core.schema.schemas.exceptions.UndefinedSchemaProperty: Undefined properties in schema: {'package'}

smarlowucf avatar Jul 26 '18 20:07 smarlowucf