Skip to content

Commit 775b578

Browse files
authored
Merge pull request #1574 from json-schema-org/gregsdennis/format-registry
Gregsdennis/format registry
2 parents 8af8969 + ae1edc7 commit 775b578

File tree

2 files changed

+395
-10
lines changed

2 files changed

+395
-10
lines changed

Diff for: specs/jsonschema-validation.md

+20-10
Original file line numberDiff line numberDiff line change
@@ -325,30 +325,40 @@ from previous iterations of this specification. Previously, `format` was an
325325
annotation-only keyword by default and implementations that supported assertion
326326
were required to offer some configuration that allowed users to explicitly
327327
enable assertion. Assertion is now a requirement in order to meet user
328-
expectations. See [json-schema-org/json-schema-spec
329-
#1520](https://github.com/json-schema-org/json-schema-spec/issues/1520) for
330-
more.
328+
expectations. See
329+
[json-schema-org/json-schema-spec #1520](https://github.com/json-schema-org/json-schema-spec/issues/1520)
330+
for more.
331331

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

335335
Implementations:
336336

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

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

351-
#### Custom format values
351+
#### Format Registry {#format-registry}
352+
353+
In addition to the formats defined by this document, JSON Schema also maintains
354+
a registry of formats defined by other specifications and organizations. As of
355+
the publication of this document, the format registry can be found at
356+
<https://github.com/json-schema-org/json-schema-spec/blob/main/specs/registries/format.json>.
357+
358+
Implementations SHOULD support the formats listed in this registry as if they
359+
were defined by this document.
360+
361+
#### Custom `format` Values
352362

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

0 commit comments

Comments
 (0)