Skip to content

Commit 77c1386

Browse files
committed
relint all files
1 parent 7b6b655 commit 77c1386

File tree

19 files changed

+2047
-2225
lines changed

19 files changed

+2047
-2225
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v2
1414
- uses: actions/setup-node@v2
1515
with:
16-
node-version: "lts/*"
16+
node-version: 'lts/*'
1717
- run: npm ci
1818
- run: npm run build --if-present
1919
- run: npm test

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
- uses: actions/checkout@v2
1010
- uses: actions/setup-node@v2
1111
with:
12-
node-version: "lts/*"
12+
node-version: 'lts/*'
1313
- name: npm install, build, and test
1414
run: |
1515
npm ci

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Changelog
2+
23
All notable changes to this project will be documented in this file.
34

45
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
@@ -7,26 +8,35 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
78
## [1.0.0] - 2020-01-20
89

910
### Changed
11+
1012
- Moved over to the `@openapi-contrib` NPM organization.
1113

1214
## [0.4.0] - 2019-10-04
15+
1316
### Added
17+
1418
- Take the first JSON Schema `example` and put in OpenAPI Schema Object `example`
1519

1620
## [0.3.0] - 2018-12-18
21+
1722
### Added
23+
1824
- Create empty items, as it must always be present for type: array
1925
- Rewrite exclusiveMinimum/exclusiveMaximum
2026
- Rewrite if/then/else as oneOf + allOf
2127
- Rewrite const as single element enum
2228

2329
## [0.2.0] - 2018-05-10
30+
2431
### Fixed
32+
2533
- Implemented [@cloudflare/json-schema-walker] to make sure all subschemas are
2634
processed
2735

2836
[@cloudflare/json-schema-walker]: https://github.com/cloudflare/json-schema-tools#cloudflarejson-schema-walker
2937

3038
## [0.1.1] - 2018-04-09
39+
3140
### Added
41+
3242
- Convert `dependencies` to an allOf + oneOf OpenAPI-valid equivalent

README.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ A little NodeJS package to convert JSON Schema to a [OpenAPI Schema Object](http
66

77
## Features
88

9-
* converts JSON Schema Draft 04 to OpenAPI 3.0 Schema Object
10-
* switches `type: ['foo', 'null']` to `type: foo` and `nullable: true`
11-
* supports deep structures with nested `allOf`s etc.
12-
* switches `patternProperties` to `x-patternProperties`
13-
* converts `dependencies` to an allOf + oneOf OpenAPI-valid equivalent
9+
- converts JSON Schema Draft 04 to OpenAPI 3.0 Schema Object
10+
- switches `type: ['foo', 'null']` to `type: foo` and `nullable: true`
11+
- supports deep structures with nested `allOf`s etc.
12+
- switches `patternProperties` to `x-patternProperties`
13+
- converts `dependencies` to an allOf + oneOf OpenAPI-valid equivalent
1414

1515
## Installation
1616

17-
``` shell
17+
```shell
1818
npm install --save @openapi-contrib/json-schema-to-openapi-schema
1919
```
2020

@@ -28,16 +28,15 @@ Here's a small example to get the idea:
2828
const convert = require('@openapi-contrib/json-schema-to-openapi-schema');
2929

3030
const schema = {
31-
'$schema': 'http://json-schema.org/draft-04/schema#',
32-
type: ['string', 'null'],
33-
format: 'date-time',
31+
$schema: 'http://json-schema.org/draft-04/schema#',
32+
type: ['string', 'null'],
33+
format: 'date-time',
3434
};
3535

3636
(async () => {
37-
const convertedSchema = await convert(schema);
38-
console.log(convertedSchema);
37+
const convertedSchema = await convert(schema);
38+
console.log(convertedSchema);
3939
})();
40-
4140
```
4241

4342
The example prints out
@@ -117,8 +116,8 @@ This package is [Treeware](https://treeware.earth). If you use it in production,
117116
- [All Contributors][link-contributors]
118117

119118
[mikunn]: https://github.com/mikunn
120-
[WeWork]: https://github.com/wework
121-
[Stoplight]: https://stoplight.io/
122-
[Phil Sturgeon]: https://github.com/philsturgeon
119+
[wework]: https://github.com/wework
120+
[stoplight]: https://stoplight.io/
121+
[phil sturgeon]: https://github.com/philsturgeon
123122
[openapi-schema-to-json-schema]: https://github.com/openapi-contrib/openapi-schema-to-json-schema
124123
[link-contributors]: https://github.com/openapi-contrib/json-schema-to-openapi-schema/graphs/contributors

bin/help-text.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
2-
"default": [
3-
"Usage:",
4-
" json-schema-to-openapi-schema <command> [options] <file>",
5-
"",
6-
"Commands:",
7-
" convert Converts JSON Schema Draft 04 to OpenAPI 3.0 Schema Object",
8-
"",
9-
"Options:",
10-
" -h, --help Show help for any command",
11-
" -v, --version Output the CLI version number",
12-
" -d, --dereference If set all local and remote references (http/https and file) $refs will be dereferenced",
13-
""
14-
],
15-
"convert": [
16-
"Converts JSON Schema Draft 04 to OpenAPI 3.0 Schema Object.",
17-
"Returns a non-zero exit code if conversion fails.",
18-
"",
19-
"Usage:",
20-
" json-schema-to-openapi-schema convert [options] <file>",
21-
"",
22-
"Options:",
23-
" -d, --dereference If set all local and remote references (http/https and file) $refs will be dereferenced",
24-
""
25-
]
26-
}
2+
"default": [
3+
"Usage:",
4+
" json-schema-to-openapi-schema <command> [options] <file>",
5+
"",
6+
"Commands:",
7+
" convert Converts JSON Schema Draft 04 to OpenAPI 3.0 Schema Object",
8+
"",
9+
"Options:",
10+
" -h, --help Show help for any command",
11+
" -v, --version Output the CLI version number",
12+
" -d, --dereference If set all local and remote references (http/https and file) $refs will be dereferenced",
13+
""
14+
],
15+
"convert": [
16+
"Converts JSON Schema Draft 04 to OpenAPI 3.0 Schema Object.",
17+
"Returns a non-zero exit code if conversion fails.",
18+
"",
19+
"Usage:",
20+
" json-schema-to-openapi-schema convert [options] <file>",
21+
"",
22+
"Options:",
23+
" -d, --dereference If set all local and remote references (http/https and file) $refs will be dereferenced",
24+
""
25+
]
26+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"eslint-plugin-unused-imports": "^2.0.0",
5050
"mocha": "^10.0.0",
5151
"nock": "^13.2.9",
52+
"prettier": "^2.7.1",
5253
"should": "^13.2.3",
5354
"typescript": "^4.7.4",
5455
"vitest": "^0.20.2"

0 commit comments

Comments
 (0)