Skip to content

Gregsdennis/format registry #1574

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

Merged
merged 9 commits into from
Apr 19, 2025
30 changes: 20 additions & 10 deletions specs/jsonschema-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,30 +325,40 @@ from previous iterations of this specification. Previously, `format` was an
annotation-only keyword by default and implementations that supported assertion
were required to offer some configuration that allowed users to explicitly
enable assertion. Assertion is now a requirement in order to meet user
expectations. See [json-schema-org/json-schema-spec
#1520](https://github.com/json-schema-org/json-schema-spec/issues/1520) for
more.
expectations. See
[json-schema-org/json-schema-spec #1520](https://github.com/json-schema-org/json-schema-spec/issues/1520)
for more.

In addition to the assertion behavior, this keyword also produces its value as
an annotation.

Implementations:

- SHOULD provide validation for each format attribute defined in this
document;
- MAY support format values not defined in this document, but such support MUST
be configurable and disabled by default;
- SHOULD provide validation for each format attribute defined in this document;
- are encouraged to provide validation for format attributes listed in the
{{format-registry}};
- MAY support format values not defined in this document or listed in the
registry, but such support MUST be configurable and disabled by default;
- SHOULD use a common parsing library or a well-known regular expression for
each format;
- SHOULD clearly document how and to what degree each format attribute is
validated.
- SHOULD clearly document any limitations regarding format validation.

The requirement for validation of format values in general is limited to
syntactic checking; implementations SHOULD NOT attempt to send an email, connect
to a URL, or otherwise check the existence of an entity identified by a format
instance.

#### Custom format values
#### Format Registry {#format-registry}

In addition to the formats defined by this document, JSON Schema also maintains
a registry of formats defined by other specifications and organizations. As of
the publication of this document, the format registry can be found at
<https://github.com/json-schema-org/json-schema-spec/blob/main/specs/registries/format.json>.

Implementations SHOULD support the formats listed in this registry as if they
were defined by this document.

#### Custom `format` Values

Implementations MAY support custom format values. Save for agreement between
parties, schema authors SHALL NOT expect a peer implementation to support such
Expand Down
Loading