Skip to content

Commit

Permalink
Merge pull request #12 from apiture/DavidBiesack-patch-1
Browse files Browse the repository at this point in the history
Update README.md to doument  $comment -> x-comment conversion
  • Loading branch information
DavidBiesack authored Nov 22, 2023
2 parents 2a2e4c3 + a9f9467 commit fe59bc9
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,40 @@ becomes
...
```

### Rename `$comment` as `x-comment`

The tool renames the `$comment` keyword in schema objects as `x-comment`
as `$comment` is not supported in OAS 3.0 JSON Schema Draft 4
used in OAS 3.0. and can cause problems with some tools.
`x-comment` is more easily ignored since it does not start with `$`.

For exmample,
```yaml
Problems:
title: Problems
description: Problem Items
type: array
maxItems: 1000
$comment: >-
The value 1000 here must match `maxItems` in the ProblemList schema.
items:
$ref: '#/components/schemas/apiProblem'
```
becomes
```yaml
Problems:
title: Problems
description: Problem Items
type: array
maxItems: 1000
x-comment: >-
The value 1000 here must match `maxItems` in the ProblemList schema.
items:
$ref: '#/components/schemas/apiProblem'
```
### Remove schema `$id` and `$schema`

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

0 comments on commit fe59bc9

Please sign in to comment.