Skip to content

Commit 9d32eb6

Browse files
committed
Fix spec markdown lint errors
1 parent 4605b74 commit 9d32eb6

9 files changed

+146
-98
lines changed

build/build.js

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import remarkGfm from "remark-gfm";
1111
import remarkHeadingId from "remark-heading-id";
1212
import remarkHeadings from "./remark-headings.js";
1313
import remarkPresetLintMarkdownStyleGuide from "remark-preset-lint-markdown-style-guide";
14+
import remarkLintMaximumHeadingLength from "remark-lint-maximum-heading-length";
1415
import remarkRehype from "remark-rehype";
1516
import remarkReferenceLinks from "./remark-reference-links.js";
1617
import remarkTableOfContents from "./remark-table-of-contents.js";
@@ -25,6 +26,7 @@ const build = async (filename) => {
2526
const md = readFileSync(filename, "utf-8");
2627
const file = await remark()
2728
.use(remarkPresetLintMarkdownStyleGuide)
29+
.use(remarkLintMaximumHeadingLength, false)
2830
.use(remarkGfm)
2931
.use(remarkHeadingId)
3032
.use(remarkHeadings, {

jsonschema-core.md

+34-18
Original file line numberDiff line numberDiff line change
@@ -2051,7 +2051,7 @@ specified for the `application/json` media type. See [JSON](#rfc8259).
20512051
Security considerations:: See {{security}} above.
20522052

20532053
Interoperability considerations:: See Sections [6.2](#language),
2054-
[6.3](#integers), and [6.4](#regex) above.
2054+
[6.3](#data-model), and [6.4](#regex) above.
20552055

20562056
Fragment identifier considerations:: See {{fragments}}
20572057

@@ -2072,7 +2072,7 @@ specified for the `application/json` media type. See [JSON](#rfc8259).
20722072
Security considerations:: See {{security}} above.
20732073

20742074
Interoperability considerations:: See Sections [6.2](#language),
2075-
[6.3](#integers), and [6.4](#regex) above.
2075+
[6.3](#data-model), and [6.4](#regex) above.
20762076

20772077
Fragment identifier considerations:: See {{fragments}}
20782078

@@ -2467,32 +2467,48 @@ to the document.
24672467

24682468
### draft-bhutton-json-schema-next
24692469
- Use IRIs instead of URIs, including allowing unicode in plain-name fragments
2470-
- Clarify that detecting duplicate IRIs for different schemas SHOULD raise an error
2470+
- Clarify that detecting duplicate IRIs for different schemas SHOULD raise an
2471+
error
24712472
- Consolidate and clarify the syntax and rationale for plain-name fragments
24722473
- "$id" MUST be an absolute-IRI, without any fragment, even an empty one
2473-
- Note that an empty string "$id" results in duplicate IRIs for different schemas
2474+
- Note that an empty string "$id" results in duplicate IRIs for different
2475+
schemas
24742476
- Define empty schemas as empty (no longer allowing unrecognized keywords)
2475-
- Clarify that if unknown properties are not treated as annotations, they MUST be ignored
2476-
- Remove outdated pre-annotation-collection section on annotation-applicator interaction
2477+
- Clarify that if unknown properties are not treated as annotations, they MUST
2478+
be ignored
2479+
- Remove outdated pre-annotation-collection section on annotation-applicator
2480+
interaction
24772481
- Clarify that regular expressions are not anchored
2478-
- Specify valid implementation-defined options for handling schemas without "$schema"
2479-
- Clarify that vocabularies omitted from "$vocabulary" MUST NOT be available for use
2480-
- Clarify that standard keywords are only available as vocabulary keywords, subject to "$vocabulary" control
2481-
- Clarify the nature and purpose of optional (set to false in "$vocabulary") vocabularies
2482-
- Clarify that optional simple-annotation-only vocabularies can be supported without custom code
2483-
- Fix typo that "$vocabulary" can only be in a document root; it is legal in resource roots
2482+
- Specify valid implementation-defined options for handling schemas without
2483+
"$schema"
2484+
- Clarify that vocabularies omitted from "$vocabulary" MUST NOT be available for
2485+
use
2486+
- Clarify that standard keywords are only available as vocabulary keywords,
2487+
subject to "$vocabulary" control
2488+
- Clarify the nature and purpose of optional (set to false in "$vocabulary")
2489+
vocabularies
2490+
- Clarify that optional simple-annotation-only vocabularies can be supported
2491+
without custom code
2492+
- Fix typo that "$vocabulary" can only be in a document root; it is legal in
2493+
resource roots
24842494
- Remove bookending requirement for `$dynamicRef`
24852495
- Clarify that "prefixItems" does not constrain the length of an array
2486-
- Move "minContains" and "maxContains" to the applicator vocabulary from validation
2496+
- Move "minContains" and "maxContains" to the applicator vocabulary from
2497+
validation
24872498
- "minContains" and "maxContains" no longer have their own assertion results
24882499
- "contains" assertion result now depends on "minContains" and "maxContains"
2489-
- Affirm that no keyword can un-fail an adjacent keyword ("minContains" previously violated this)
2490-
- "contains", "minContains", and "maxContains" now apply to objects as well as arrays
2500+
- Affirm that no keyword can un-fail an adjacent keyword ("minContains"
2501+
previously violated this)
2502+
- "contains", "minContains", and "maxContains" now apply to objects as well as
2503+
arrays
24912504
- As an object keyword, "contains" now affects "unevaluatedProperties"
24922505
- Add `propertyDependencies` keyword
2493-
- Add new "list" and "hierarchical" output formats in place of "basic", "detailed", and "verbose"
2494-
- Rename "absoluteKeywordLocation" and "keywordLocation" to "schemaLocation" and "evaluationPath"
2495-
- Output units in new format group by "schemaLocation", "instanceLocation", and "evaluationPath"
2506+
- Add new "list" and "hierarchical" output formats in place of "basic",
2507+
"detailed", and "verbose"
2508+
- Rename "absoluteKeywordLocation" and "keywordLocation" to "schemaLocation" and
2509+
"evaluationPath"
2510+
- Output units in new format group by "schemaLocation", "instanceLocation", and
2511+
"evaluationPath"
24962512
- Add "droppedAnnotations" to output formats
24972513

24982514
### draft-bhutton-json-schema-01

jsonschema-validation-output-machines.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,14 @@ The failing instance will produce the following errors:
172172
is not a number.
173173

174174
<!--
175-
"minimum" doesn't produce an error because it only operates on instances that are numbers.
175+
"minimum" doesn't produce an error because it only operates on instances that
176+
are numbers.
176177
-->
177178
<!--
178-
Note that the error message wording as depicted in the examples below is not a requirement of this specification. Implementations SHOULD craft error messages tailored for their audience or provide a templating mechanism that allows their users to craft their own messages.
179+
Note that the error message wording as depicted in the examples below is not a
180+
requirement of this specification. Implementations SHOULD craft error messages
181+
tailored for their audience or provide a templating mechanism that allows their
182+
users to craft their own messages.
179183
-->
180184

181185
The passing instance will produce the following annotations:

jsonschema-validation.md

+18-14
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ Omitting this keyword has the same behavior as a value of 0.
234234

235235
The value of this keyword MUST be a boolean.
236236

237-
If this keyword has boolean value `false`, the instance validates successfully. If
238-
it has boolean value `true`, the instance validates successfully if all of its
239-
elements are unique.
237+
If this keyword has boolean value `false`, the instance validates successfully.
238+
If it has boolean value `true`, the instance validates successfully if all of
239+
its elements are unique.
240240

241241
Omitting this keyword has the same behavior as a value of `false`.
242242

@@ -317,8 +317,8 @@ which choose to support assertion behavior:
317317

318318
- MUST still collect the keyword's value as an annotation (if the implementation
319319
supports annotation collection),
320-
- MUST provide a configuration option to enable assertion behavior, defaulting to
321-
annotation-only behavior
320+
- MUST provide a configuration option to enable assertion behavior, defaulting
321+
to annotation-only behavior
322322
- SHOULD provide an implementation-specific best effort validation for each
323323
format attribute defined below;[^3]
324324
- MAY choose to implement validation of any or all format attributes as a no-op
@@ -662,7 +662,8 @@ associated schema.
662662

663663
The value of this keyword MUST be a boolean. When multiple occurrences of this
664664
keyword are applicable to a single sub-instance, applications SHOULD consider
665-
the instance location to be deprecated if any occurrence specifies a `true` value.
665+
the instance location to be deprecated if any occurrence specifies a `true`
666+
value.
666667

667668
If `deprecated` has a value of boolean `true`, it indicates that applications
668669
SHOULD refrain from usage of the declared property. It MAY mean the property is
@@ -695,11 +696,11 @@ An instance document that is marked as `readOnly` for the entire document MAY be
695696
ignored if sent to the owning authority, or MAY result in an error, at the
696697
authority's discretion.
697698

698-
If `writeOnly` has a value of boolean `true`, it indicates that the value is never
699-
present when the instance is retrieved from the owning authority. It can be
700-
present when sent to the owning authority to update or create the document (or
701-
the resource it represents), but it will not be included in any updated or newly
702-
created version of the instance.
699+
If `writeOnly` has a value of boolean `true`, it indicates that the value is
700+
never present when the instance is retrieved from the owning authority. It can
701+
be present when sent to the owning authority to update or create the document
702+
(or the resource it represents), but it will not be included in any updated or
703+
newly created version of the instance.
703704

704705
An instance document that is marked as `writeOnly` for the entire document MAY
705706
be returned as a blank document of some sort, or MAY produce an error upon
@@ -899,9 +900,12 @@ to the document.
899900

900901
- *draft-next*
901902
- Use IRIs instead of URIs
902-
- Move "minContains" and "maxContains" to the applicator vocabulary (see also that changelog)
903-
- Remove the optional automatic second-pass validation of "content*" keywords
904-
- Clarify that "contentSchema"'s value is a schema just like any other subschema
903+
- Move "minContains" and "maxContains" to the applicator vocabulary (see
904+
also that changelog)
905+
- Remove the optional automatic second-pass validation of "content*"
906+
keywords
907+
- Clarify that "contentSchema"'s value is a schema just like any other
908+
subschema
905909
- *draft-bhutton-json-schema-validation-01*
906910
- Improve and clarify the `minContains` keyword explanation
907911
- Remove the use of "production" in favour of "ABNF rule"

proposals/propertyDependencies-adr.md

+27-18
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
# Add New Keyword: `propertyDependencies`
22

3-
* Status: proposed
4-
* Deciders: @gregsdennis, @jdesrosiers, @relequestual
5-
* Date: 2022-04-07
3+
- Status: proposed
4+
- Deciders: @gregsdennis, @jdesrosiers, @relequestual
5+
- Date: 2022-04-07
66

77
Technical Story:
88

9-
- Issue discussing feature - https://github.com/json-schema-org/json-schema-spec/issues/1082
10-
- PR to add to the spec - https://github.com/json-schema-org/json-schema-spec/pull/1143
11-
- ADR to extract from the spec and use feature life cycle - https://github.com/json-schema-org/json-schema-spec/pull/1505
9+
- Issue discussing feature - <https://github.com/json-schema-org/json-schema-spec/issues/1082>
10+
- PR to add to the spec - <https://github.com/json-schema-org/json-schema-spec/pull/1143>
11+
- ADR to extract from the spec and use feature life cycle - <https://github.com/json-schema-org/json-schema-spec/pull/1505>
12+
13+
## Table of Contents
1214

1315
## Context and Problem Statement
1416

@@ -33,7 +35,8 @@ adopt or redefine `discriminator`.
3335

3436
## Considered Options
3537

36-
All of the following options have the same validation result as the following schema.
38+
All of the following options have the same validation result as the following
39+
schema.
3740

3841
```json
3942
{
@@ -64,10 +67,10 @@ that concept to solve this problem.
6467
}
6568
```
6669

67-
* Good, because it handle the most common use case: string property values
68-
* Good, because all property values are grouped together
69-
* Good, because it's less verbose
70-
* Bad, because it doesn't handle non-string property values
70+
- Good, because it handle the most common use case: string property values
71+
- Good, because all property values are grouped together
72+
- Good, because it's less verbose
73+
- Bad, because it doesn't handle non-string property values
7174

7275
### Option 2
7376

@@ -97,7 +100,9 @@ prone.
97100
* Good, because it supports all use cases
98101
* Bad, because properties are not naturally grouped together
99102
* Bad, because it's quite verbose
100-
* Bad, because we have no precedent for a keyword which explicitly defines its own properties. This would be new operational functionality, which we try to avoid if we can.
103+
* Bad, because we have no precedent for a keyword which explicitly defines its
104+
own properties. This would be new operational functionality, which we try to
105+
avoid if we can.
101106

102107
### Option 3
103108

@@ -124,7 +129,9 @@ object. It's still too verbose.
124129
* Good, because it supports all use cases
125130
* Good, because all property values are grouped together
126131
* Bad, because it's quite verbose
127-
* Bad, because we have no precedent for a keyword which explicitly defines its own properties. This would be new operational functionality, which we try to avoid if we can.
132+
* Bad, because we have no precedent for a keyword which explicitly defines its
133+
own properties. This would be new operational functionality, which we try to
134+
avoid if we can.
128135

129136
### Option 4
130137

@@ -148,10 +155,11 @@ naming aside), but otherwise has all the same problems as the other examples.
148155
}
149156
```
150157

151-
* Good, because it supports all use cases
152-
* Bad, because properties are not naturally grouped together
153-
* Bad, because it's very verbose
154-
* Bad, because it introduces a lot of inter-keyword dependencies, which we'd have to exhaustively define
158+
- Good, because it supports all use cases
159+
- Bad, because properties are not naturally grouped together
160+
- Bad, because it's very verbose
161+
- Bad, because it introduces a lot of inter-keyword dependencies, which we'd
162+
have to exhaustively define
155163

156164
### Option 5
157165

@@ -183,7 +191,8 @@ verbose.
183191
* Good, because it's a familiar syntax
184192
* Bad, because properties are not naturally grouped together
185193
* Bad, because it's very verbose
186-
* Bad, because `ifProperties` is very niche. Will this spawn a new series of `if*` keywords? How would it interact with `if`?
194+
* Bad, because `ifProperties` is very niche. Will this spawn a new series of
195+
`if*` keywords? How would it interact with `if`?
187196

188197
### Option 6
189198

proposals/propertyDependencies.md

+19-13
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ specification](../jsonschema-core.html) also apply to this document.
3939
A common need in JSON Schema is to select between one schema or another to
4040
validate an instance based on the value of some property in the JSON instance.
4141
There are a several patterns people use to accomplish this, but they all have
42-
significant [problems](propertyDependencies-adr.md#problems). <!-- Update when moving ADR -->
42+
significant [problems](propertyDependencies-adr.md#problems). <!-- Update when
43+
moving ADR -->
4344

4445
OpenAPI solves this problem with the `discriminator` keyword. However, their
4546
approach is more oriented toward code generation concerns, is poorly specified
@@ -88,26 +89,31 @@ those goals means that some trade-offs need to be made.
8889

8990
## Change Description
9091

91-
The `propertyDependencies` keyword will be added to the `https://json-schema.org/vocab/applicator` [applicator
92+
The `propertyDependencies` keyword will be added to the
93+
`https://json-schema.org/vocab/applicator` [applicator
9294
vocabulary](../jsonschema-core.html#applicatorvocab).
9395

94-
1. The following will be added to the JSON Schema Core specification as a
96+
1. The following will be added to the JSON Schema Core specification as a
9597
subsection of "Keywords for Applying Subschemas Conditionally".
9698
> ### `propertyDependencies`
9799
>
98100
> This keyword specifies subschemas that are evaluated if the instance is an
99101
> object and contains a certain property with a certain string value.
100102
>
101-
> This keyword's value MUST be an object. Each value in the object MUST be an
102-
> object whose values MUST be valid JSON Schemas.
103+
> This keyword's value MUST be an object. Each value in the object MUST be
104+
> an object whose values MUST be valid JSON Schemas.
103105
>
104-
> If the outer object key is a property in the instance and the inner object key
105-
> is equal to the value of that property, the entire instance must validate
106-
> against the schema. Its use is dependent on the presence and value of the
107-
> property.
106+
> If the outer object key is a property in the instance and the inner object
107+
> key is equal to the value of that property, the entire instance must
108+
> validate against the schema. Its use is dependent on the presence and
109+
> value of the property.
108110
>
109111
> Omitting this keyword has the same behavior as an empty object.
110-
2. The following subschema will be added to the Applicator Vocabulary schema, `https://json-schema.org/<version>/<release>/meta/applicator` at `/properties/propertyDependencies`:
112+
113+
2. The following subschema will be added to the Applicator Vocabulary schema,
114+
`https://json-schema.org/<version>/<release>/meta/applicator` at
115+
`/properties/propertyDependencies`:
116+
111117
```json
112118
{
113119
"type": "object",
@@ -124,9 +130,9 @@ subsection of "Keywords for Applying Subschemas Conditionally".
124130

125131
## [Appendix] Change Log
126132

127-
* [March 2021] - Initially proposed
128-
* [October 2021] Added to specification document
129-
* [May 2024] Extracted from specification document as experimental feature
133+
- [March 2021] - Initially proposed
134+
- [October 2021] Added to specification document
135+
- [May 2024] Extracted from specification document as experimental feature
130136

131137
## Champions
132138

proposals/proposal-template.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
## Abstract
44

55
<!--
6-
Fill in the specification(s) that will change. If adding a keyword, which vocabulary
7-
will contain it?
6+
Fill in the specification(s) that will change. If adding a keyword, which
7+
vocabulary will contain it?
88
99
For example
1010

0 commit comments

Comments
 (0)