-
-
Notifications
You must be signed in to change notification settings - Fork 863
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
Nullable true not being read on object #983
Comments
I found the solution to this issue and hopefully this will help anyone else with this issue. So the option to use
Sorry for the noise, hopefully this is still helpful to anyone seeing this as well. |
Wow, thanks a lot this. Came in clutch |
Seems that the posted solution is no longer up to date in 8.12.0. Is there any alternative? I am still using Openapi 3.0.0 |
Hello, I'm using AJV to validate a response object to a OpenApi3.0 schema. Within the project we built a method thats a pass through to AJV called "schemaValdiator". The issue we ran into is that the
nullable
attribute doesn't appear to be read when nested in larges schemas. This results in an like described below. Even thoughnullable
is set to true the validate method returns an error regarding the type. Changing"type": "object",
to"type": ["object", "null"],
will fix the issue but this feels hacky as AJV should read the"nullable": true
attribute.Version: 6.10.0
TOP LEVEL JSON Schema
Sample data
Your code
Validation result, data AFTER validation, error messages
What results did you expect?
Schema to be validated successfully.
The text was updated successfully, but these errors were encountered: