-
Notifications
You must be signed in to change notification settings - Fork 8
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
AJV validating URL properties as format uri-reference
?
#94
Comments
Hi, I did some research: There has apparantly been a change between 3.0 and 3.1 of the specification: openapi-schema-validator/schemas/v3.0/schema.json Lines 140 to 148 in a400a7f
See also: https://spec.openapis.org/oas/v3.0.3#server-object 3.1 describes it as : openapi-schema-validator/schemas/v3.1/schema.json Lines 165 to 172 in d62b397
See also: https://spec.openapis.org/oas/v3.1.0#server-object It seems like the OpenAPI team have decided to apply more strict rules on this object. And since the spec at https://github.com/APIs-guru/openapi-directory/blob/main/APIs/discourse.local/latest/openapi.yaml starts with Looking at the 'blame' of the 3.1 schema: https://github.com/OAI/OpenAPI-Specification/blame/main/schemas/v3.1/schema.json#L171 it seems that this tightening of the rules was introduced by: OAI/OpenAPI-Specification#2586 Hope this helps ! Kind regards, |
Thanks. |
Correct, that also surprised me ;-)
Maybe I should have my script double check that ;-) Kind regards, |
Ok, just updated my script. It now doesn't take the openapiVer from https://api.apis.guru/v2/list.json anymore but reads the version from the file. Hope this reduces confusion ;-) Kind regards, |
And I've fixed the bug and incorrect metadata on my side. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days' |
As soon as the new version is available I will publish a new release. Good to see you fixed it at the source 👍 |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days' |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days' |
@nielthiart thanks for the tip! Good to see this one has been adressed. Unfortunately it looks like the YAML file and the JSON file are modified by different PR's so its unclear to me if they represent the same data, can you confirm ? The header is still: Kind regards, |
Hi Hans, yes it looks like the spec ID hasn't changed, so this update isn't released yet. In the meanwhile, would you consider accepting a PR that brings this validation library in line with the specification, similar to how you currently replace $dynamicRefs by normal $refs? The OAS project reminds validation libraries to treat the released text Specification as authoritative in the case of conflicts with the JSON schema:
The text Specification allows unformatted strings in server URLs, which would validate URLs with template strings in. |
Niel, I'd rather wait for the official release as it seems nearly ready. If you want to speed things up then getting OAS to publish their new schema seems the best course of action to me. Kind regards, |
See https://github.com/seriousme/openapi-schema-validator/blob/master/test/realworld/failed.md#api-discourselocal-version-latest
The linked schema has no
format
keyword, butajv
is complaining thatservers.url
should be auri-reference
. This looks incorrect as the appropriateformat
would beuri-template
(though I'm not sure which Draft of JSON Schema introduced thatformat
value).The text was updated successfully, but these errors were encountered: