Skip to content

Accept https:// JSON Schema URIs#98

Open
elias-ba wants to merge 1 commit intojonasschmidt:masterfrom
elias-ba:accept-https-schema-uri
Open

Accept https:// JSON Schema URIs#98
elias-ba wants to merge 1 commit intojonasschmidt:masterfrom
elias-ba:accept-https-schema-uri

Conversation

@elias-ba
Copy link
Copy Markdown

@elias-ba elias-ba commented May 1, 2026

Closes #97.

schema_module/2 and remote_schema/1 only matched the canonical http:// prefix, so any schema using https://json-schema.org/... (which json-schema.org's own site serves) was rejected with UnsupportedSchemaVersionError. Per the spec, $schema is an identifier, not a literal URL.

A head clause on each function rewrites https://json-schema.org/... to http://json-schema.org/... before dispatch. No behavioural change for any other input.

A new test in test/ex_json_schema/schema_test.exs exercises both URI forms for drafts 6 and 7. The three failures already present in schema_test.exs predate this change (the bundled fixture server returns 500 for those cases on master).

The JSON Schema spec calls $schema an identifier, not a literal URL, and
json-schema.org now serves both http:// and https:// forms. Tools commonly
emit https://, but `schema_module/2` and `remote_schema/1` only matched the
canonical http:// prefix and raised UnsupportedSchemaVersionError on any
https:// input.

Normalize https://json-schema.org/... to http://json-schema.org/... at the
top of both functions. No behavioural change for any other input.

Closes jonasschmidt#97
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Schemas with https:// $schema URIs raise UnsupportedSchemaVersionError

1 participant