@scalar/openapi-parser
Advanced tools
Comparing version
# @scalar/openapi-parser | ||
## 0.18.1 | ||
### Patch Changes | ||
- 2d7f995: refactor: use more common straight apostrophe ' instead of the real apostrophe ’ | ||
## 0.18.0 | ||
@@ -4,0 +10,0 @@ |
@@ -11,7 +11,7 @@ import Swagger20 from "../schemas/v2.0/schema.js"; | ||
const ERRORS = { | ||
EMPTY_OR_INVALID: "Can\u2019t find JSON, YAML or filename in data.", | ||
EMPTY_OR_INVALID: "Can't find JSON, YAML or filename in data.", | ||
// URI_MUST_BE_STRING: 'uri parameter or $id attribute must be a string', | ||
OPENAPI_VERSION_NOT_SUPPORTED: "Can\u2019t find supported Swagger/OpenAPI version in the provided document, version must be a string.", | ||
INVALID_REFERENCE: "Can\u2019t resolve reference: %s", | ||
EXTERNAL_REFERENCE_NOT_FOUND: "Can\u2019t resolve external reference: %s", | ||
OPENAPI_VERSION_NOT_SUPPORTED: "Can't find supported Swagger/OpenAPI version in the provided document, version must be a string.", | ||
INVALID_REFERENCE: "Can't resolve reference: %s", | ||
EXTERNAL_REFERENCE_NOT_FOUND: "Can't resolve external reference: %s", | ||
FILE_DOES_NOT_EXIST: "File does not exist: %s", | ||
@@ -18,0 +18,0 @@ NO_CONTENT: "No content found" |
@@ -56,3 +56,3 @@ import type { OpenAPI } from '@scalar/openapi-types'; | ||
/** | ||
* Holds all information about a single file (doesn’t have to be a literal file, see Filesystem). | ||
* Holds all information about a single file (doesn't have to be a literal file, see Filesystem). | ||
*/ | ||
@@ -59,0 +59,0 @@ export type FilesystemEntry = { |
@@ -5,5 +5,5 @@ import type { AnyObject } from '../types/index.js'; | ||
* | ||
* Warning: Doesn’t return internal references. | ||
* Warning: Doesn't return internal references. | ||
*/ | ||
export declare function getListOfReferences(specification: AnyObject): string[]; | ||
//# sourceMappingURL=get-list-of-references.d.ts.map |
@@ -6,5 +6,5 @@ import type { UnknownObject } from '@scalar/types/utils'; | ||
* | ||
* Doesn’t modify the object if it’s a `Filesystem` (multiple files) already. | ||
* Doesn't modify the object if it's a `Filesystem` (multiple files) already. | ||
*/ | ||
export declare function normalize(content: string | UnknownObject | Filesystem): UnknownObject | Filesystem; | ||
//# sourceMappingURL=normalize.d.ts.map |
@@ -8,5 +8,5 @@ import type { OpenAPI } from '@scalar/openapi-types'; | ||
* | ||
* @deprecated We’re about to drop this from the package. | ||
* @deprecated We're about to drop this from the package. | ||
*/ | ||
export declare function sanitize(definition: AnyObject): OpenAPI.Document; | ||
//# sourceMappingURL=sanitize.d.ts.map |
@@ -34,3 +34,3 @@ import { traverse } from "./traverse.js"; | ||
const applyChangesToDocument = (schema, path) => { | ||
if (schema.type !== "undefined" && schema.nullable === true) { | ||
if (schema.type !== void 0 && schema.nullable === true) { | ||
schema.type = [schema.type, "null"]; | ||
@@ -37,0 +37,0 @@ delete schema.nullable; |
@@ -20,3 +20,3 @@ { | ||
], | ||
"version": "0.18.0", | ||
"version": "0.18.1", | ||
"engines": { | ||
@@ -67,7 +67,7 @@ "node": ">=20" | ||
"leven": "^4.0.0", | ||
"yaml": "^2.4.5" | ||
"yaml": "2.8.0" | ||
}, | ||
"devDependencies": { | ||
"@apidevtools/swagger-parser": "^10.1.0", | ||
"@types/node": "^20.17.10", | ||
"@types/node": "^22.9.0", | ||
"fastify": "^5.3.3", | ||
@@ -78,5 +78,5 @@ "json-to-ast": "^2.1.0", | ||
"vite": "5.4.19", | ||
"@scalar/build-tooling": "0.2.3", | ||
"@scalar/openapi-types": "0.3.3", | ||
"@scalar/types": "0.2.3" | ||
"@scalar/build-tooling": "0.2.4", | ||
"@scalar/openapi-types": "0.3.5", | ||
"@scalar/types": "0.2.7" | ||
}, | ||
@@ -83,0 +83,0 @@ "scripts": { |
@@ -296,3 +296,3 @@ # Scalar OpenAPI Parser | ||
There’s an `upgrade` command to upgrade all your OpenAPI documents to the latest OpenAPI version. | ||
There's an `upgrade` command to upgrade all your OpenAPI documents to the latest OpenAPI version. | ||
@@ -324,3 +324,3 @@ ```ts | ||
> ⚠️ This doesn’t support Swagger 2.0 documents. | ||
> ⚠️ This doesn't support Swagger 2.0 documents. | ||
@@ -341,3 +341,3 @@ ```ts | ||
If you’re more the then/catch type of guy, that’s fine: | ||
If you're more the then/catch type of guy, that's fine: | ||
@@ -406,3 +406,3 @@ ```ts | ||
As you see, `load()` supports plugins. You can write your own plugin, if you’d like to fetch API defintions from another data source, for example your database. Look at the source code of the `readFiles` to learn how this could look like. | ||
As you see, `load()` supports plugins. You can write your own plugin, if you'd like to fetch API defintions from another data source, for example your database. Look at the source code of the `readFiles` to learn how this could look like. | ||
@@ -428,3 +428,3 @@ #### Directly load URLs | ||
If you’re using the package in a browser environment, you may run into CORS issues when fetching from URLs. You can intercept the requests, for example to use a proxy, though: | ||
If you're using the package in a browser environment, you may run into CORS issues when fetching from URLs. You can intercept the requests, for example to use a proxy, though: | ||
@@ -450,3 +450,3 @@ ```ts | ||
We are API nerds. You too? Let’s chat on Discord: <https://discord.gg/scalar> | ||
We are API nerds. You too? Let's chat on Discord: <https://discord.gg/scalar> | ||
@@ -457,5 +457,5 @@ ## Thank you! | ||
- [@philsturgeon](https://github.com/philsturgeon) to make sure we build something we won’t hate. | ||
- [@philsturgeon](https://github.com/philsturgeon) to make sure we build something we won't hate. | ||
- We took a lot of inspiration from [@seriousme](https://github.com/seriousme) and his package [openapi-schema-validator](https://github.com/seriousme/openapi-schema-validator) early-on. | ||
- You could consider this package the modern successor of [@apidevtools/swagger-parser](https://github.com/APIDevTools/swagger-parser), we even test against it to make sure we’re getting the same results (where intended). | ||
- You could consider this package the modern successor of [@apidevtools/swagger-parser](https://github.com/APIDevTools/swagger-parser), we even test against it to make sure we're getting the same results (where intended). | ||
- We stole a lot of example specification from [@mermade](https://github.com/mermade) to test against. | ||
@@ -462,0 +462,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2563550
0Updated