@scalar/openapi-parser 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +5 -5
- package/dist/index.d.ts +5146 -600
- package/dist/index.js +10941 -6190
- package/dist/webpack-stats.json +1 -0
- package/package.json +11 -15
- package/dist/schema-BQQoKgNw.js +0 -1619
- package/dist/schema-BjykgtPd.js +0 -1633
- package/dist/schema-ZROhtp0X.js +0 -1453
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @scalar/openapi-parser
|
|
2
2
|
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0b7d7be: refactor!: resolve is renamed to dereference
|
|
8
|
+
- 63f72b4: refactor!: new OpenAPI types, removed the ResolvedOpenAPI types
|
|
9
|
+
- 0b7d7be: refactor!: when using the pipeline syntax all tasks are queued and only executed when you add .get(), .toJson() or toYaml()
|
|
10
|
+
- 56e7033: feat: file references
|
|
11
|
+
- 0b7d7be: chore!: remove `loadFiles` utility, use `load` instead
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 03569c8: fix: existsSync is not a function
|
|
16
|
+
- 6436ae1: refactor: resolve should resolve (and not validate)
|
|
17
|
+
|
|
3
18
|
## 0.3.2
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://github.com/scalar/openapi-parser/actions/workflows/release.yml)
|
|
5
5
|
[](https://github.com/scalar/openapi-parser/graphs/contributors)
|
|
6
6
|
[](https://github.com/scalar/openapi-parser/blob/main/LICENSE)
|
|
7
|
-
[](https://discord.gg/
|
|
7
|
+
[](https://discord.gg/scalar)
|
|
8
8
|
|
|
9
9
|
Modern OpenAPI parser written in TypeScript, with support for Swagger 2.0, OpenAPI 3.0 and OpenAPI 3.1
|
|
10
10
|
|
|
@@ -19,7 +19,7 @@ npm add @scalar/openapi-parser
|
|
|
19
19
|
### Parse
|
|
20
20
|
|
|
21
21
|
```ts
|
|
22
|
-
import {
|
|
22
|
+
import { dereference } from '@scalar/openapi-parser'
|
|
23
23
|
|
|
24
24
|
const file = `{
|
|
25
25
|
"openapi": "3.1.0",
|
|
@@ -30,7 +30,7 @@ const file = `{
|
|
|
30
30
|
"paths": {}
|
|
31
31
|
}`
|
|
32
32
|
|
|
33
|
-
const result = await
|
|
33
|
+
const result = await dereference(file)
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
### Validate
|
|
@@ -59,7 +59,7 @@ if (!result.valid) {
|
|
|
59
59
|
### Version
|
|
60
60
|
|
|
61
61
|
```ts
|
|
62
|
-
import {
|
|
62
|
+
import { dereference } from '@scalar/openapi-parser'
|
|
63
63
|
|
|
64
64
|
const file = `{
|
|
65
65
|
"openapi": "3.1.0",
|
|
@@ -70,7 +70,7 @@ const file = `{
|
|
|
70
70
|
"paths": {}
|
|
71
71
|
}`
|
|
72
72
|
|
|
73
|
-
const result = await
|
|
73
|
+
const result = await dereference(file)
|
|
74
74
|
|
|
75
75
|
console.log(result.version)
|
|
76
76
|
```
|