-
Notifications
You must be signed in to change notification settings - Fork 156
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
unevaluatedItems boolean schema error, Can't resolve $ref with component schemas #1233
Comments
Thanks for the report @jeremyfiel! |
further discussion with JSON Schema folks and they mentioned it may be an issue with resolving the base uri $id in the nested schema. It's possible ajv doesn't support this. this seems to be a very typical use case where it's equivalent to |
This is most likely an error with redocly-cli, not ajv. We don't use AJV for |
I just checked it and we indeed do not support $id in the nested schema properly. |
Created a PR with potential fix here: #1286 @jeremyfiel would you be able to test the fix for your use case? |
Per JSON Schema 2019-09+ spec. this annotation keyword can be any valid JSON Schema schema. e.g. `boolean` or `schema` https://json-schema.org/draft/2019-09/json-schema-core#unevaluatedItems partially fixes Redocly#1233
Per JSON Schema 2019-09+ spec. this annotation keyword can be any valid JSON Schema schema. e.g. `boolean` or `schema` https://json-schema.org/draft/2019-09/json-schema-core#unevaluatedItems partially fixes Redocly#1233
Per JSON Schema 2019-09+ spec. this annotation keyword can be any valid JSON Schema schema. e.g. `boolean` or `schema` https://json-schema.org/draft/2019-09/json-schema-core#unevaluatedItems partially fixes Redocly#1233
Per JSON Schema 2019-09+ spec. this annotation keyword can be any valid JSON Schema schema. e.g. `boolean` or `schema` https://json-schema.org/draft/2019-09/json-schema-core#unevaluatedItems partially fixes Redocly#1233
@tatomyr please reopen for the second item mentioned. @RomanHotsiy was still working on the pr for the embedded $id resolution. |
Describe the bug
Two issues here:
1.unevaluatedItems
is reporting an errorExpected type 'Schema' but got 'Boolean'
related to #457 and #532, I don't see
unevaluatedItems
updated similar toadditionalProperties
where it can be a boolean or a schema.Challenge
andFile
component schemas.These two referenced schemas are not resolved but they appear to be correctly defined in
items
array. I tried using https://json-schema.hyperjump.io and it says my schema is valid.To Reproduce
Steps to reproduce the behavior:
redocly.yaml
fileOAS 3.1 schema
redocly lint --config redocly.yml fcc-classroom-userdata-openapi.json --format stylish
Expected behavior
All component schemas should be referenced and
unevaluatedItems: false
is a valid schema type.Redocly Version(s)
Redocly OpenAPI - vs code v0.2.24
Node.js
Version(s)v14.18.1
The text was updated successfully, but these errors were encountered: