Closed ekzobrain closed 1 year ago
Interesting—OpenAPI validation uses their schema, which specficies uri-reference
: https://github.com/OAI/OpenAPI-Specification/blob/6627c32921a341b2a7001fd1cf9f757b8b728fd1/schemas/v3.1/schema.json#L171
But I don't think using variables (in brackets) makes for a valid uri-reference
(I also checked https://www.jsonschemavalidator.net/):
>> JSONSchemer.schema({ 'format': 'uri-reference' }).valid?('https://{subdomain}.amocrm.ru')
=> false
I'll dig into this more later, but here's what I've found so far:
I opened a pull request to change the format in the upstream schemas.
Temporary fix: https://github.com/davishmcclurg/json_schemer/pull/161
This also fixed a problem with IDNs. "uri-reference" doesn't not allow those, so at least "iri-reference" should have been used instead.
Attached file gives an error: value at
/servers/0/url
does not match format: uri-reference While according to OpenApi docs it's a valid url with variable: https://spec.openapis.org/oas/v3.1.0#fixed-fields-3 OpenApi 3.0 validator does not seem to have this problem.oas-amocrm.json