Skip to content
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

PHP model field validation broken on oneOf #12721

Open
dacgray opened this issue Jun 28, 2022 · 0 comments
Open

PHP model field validation broken on oneOf #12721

dacgray opened this issue Jun 28, 2022 · 0 comments

Comments

@dacgray
Copy link

dacgray commented Jun 28, 2022

Description
 bar:
      properties:
        field:
          type: string
          enum: [a,b]
 ray:
      properties:
        field:
          type: string
          enum: [c,d]

MyObject:
      properties:
        foo:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/bar'
              - $ref: '#/components/schemas/ray'
              ```

ObjectSerializer::deserialize (src/Http/ObjectSerializer.php:478) fails:

getFieldAllowableValues & getOperatorAllowableValues do not combine all options and validation fails.

It instead only uses enum values from the last item (ray) for validation

##### openapi-generator version

Latest

@dacgray dacgray changed the title PHP field validation broken on anyOf PHP model field validation broken on anyOf Jun 28, 2022
@dacgray dacgray changed the title PHP model field validation broken on anyOf PHP model field validation broken on oneOf Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant