Skip to content

oneOf in array items not working #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
smarlowucf opened this issue Jul 26, 2018 · 0 comments
Open

oneOf in array items not working #64

smarlowucf opened this issue Jul 26, 2018 · 0 comments

Comments

@smarlowucf
Copy link
Contributor

smarlowucf commented Jul 26, 2018

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'}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant