Skip to content

Commit fe59bc9

Browse files
authored
Merge pull request #12 from apiture/DavidBiesack-patch-1
Update README.md to doument $comment -> x-comment conversion
2 parents 2a2e4c3 + a9f9467 commit fe59bc9

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,40 @@ becomes
331331
...
332332
```
333333

334+
### Rename `$comment` as `x-comment`
335+
336+
The tool renames the `$comment` keyword in schema objects as `x-comment`
337+
as `$comment` is not supported in OAS 3.0 JSON Schema Draft 4
338+
used in OAS 3.0. and can cause problems with some tools.
339+
`x-comment` is more easily ignored since it does not start with `$`.
340+
341+
For exmample,
342+
```yaml
343+
Problems:
344+
title: Problems
345+
description: Problem Items
346+
type: array
347+
maxItems: 1000
348+
$comment: >-
349+
The value 1000 here must match `maxItems` in the ProblemList schema.
350+
items:
351+
$ref: '#/components/schemas/apiProblem'
352+
```
353+
354+
becomes
355+
356+
```yaml
357+
Problems:
358+
title: Problems
359+
description: Problem Items
360+
type: array
361+
maxItems: 1000
362+
x-comment: >-
363+
The value 1000 here must match `maxItems` in the ProblemList schema.
364+
items:
365+
$ref: '#/components/schemas/apiProblem'
366+
```
367+
334368
### Remove schema `$id` and `$schema`
335369

336370
The tool removes any `$id` or `$schema` keywords that may appear

0 commit comments

Comments
 (0)