-
Notifications
You must be signed in to change notification settings - Fork 240
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
Schema array type with anyOf and discriminator fails validation #402
Comments
I think currently that rule only looks at the properties in the schema itself without delving into the properties in the anyOf/allOf. This is a bug in our validator. |
Are there any plans to fix this bug? This validator is now being used by Azure API Management when deploying APIs, and we are no longer able to deploy updates to our existing API to production because of this problem. |
Yes reported last November. Pretty big impact for me too. Apparently a fix is rolling out next week. See #429 |
@PerthCharern any updates on this? |
I realise I hadn't understood the issue properly and this is indeed a bug in the parser that it is not traversing the anyOf link to look in the child schemas for the required discriminator field. |
Is this issue still Open? We are dealing with the similar problem. |
@himanigulati Yes, I think this is still open. |
I verified this again and I am not seeing any errors. Please re-open if you find this is still a problem. |
I can still reproduce the error with the following reproducer specification.
I get the following error:
The specification validates correctly in Swagger Editor. |
Can we get an update on the status of this fix? When can we expect a fix to be released? |
Hi everyone, This code block needs improvements:
When the validation rule doesn't find the discriminator field in the current schema's required fields, it should recursively look into the anyOf/oneOf/allOf schemas (if any) before returning an error. Ping @CarolKigoonya to bump the priority of this one given the current impact. Additionally for implementers, #383 provides additional testing cases. |
I'm trying to validate an OpenAPI document that contains a schema object that is of type 'array' that can be an 'anyOf' that uses a discriminator to know which object goes into the array and it's failing validation. The document appears to be a valid OAS3 document and the Swagger UI has no issues rendering it, so I'm guessing it's an issue with OpenAPI.NET.
I'm getting validation errors similar to:
...for this document
The text was updated successfully, but these errors were encountered: