Skip to content

Commit

Permalink
upgrade json-schema-ref-parser -> 9.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris Cherny committed May 15, 2022
1 parent 9e660a5 commit f943f32
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 160 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"glob": "^7.1.6",
"glob-promise": "^3.4.0",
"is-glob": "^4.0.1",
"json-schema-ref-parser": "^9.0.6",
"json-schema-ref-parser": "^9.0.9",
"json-stringify-safe": "^5.0.1",
"lodash": "^4.17.20",
"minimist": "^1.2.5",
Expand Down
298 changes: 149 additions & 149 deletions test/__snapshots__/test/test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -5442,11 +5442,11 @@ Generated by [AVA](https://avajs.dev).
/**␊
* unique email address of account␊
*/␊
email?: (string | null)
email?: string␊
/**␊
* unique identifier of an account␊
*/␊
id?: (string | null)
id?: string␊
[k: string]: unknown␊
}␊
/**␊
Expand Down Expand Up @@ -5682,6 +5682,142 @@ Generated by [AVA](https://avajs.dev).
}␊
`

## realWorld.jsonschema.js

> Expected output to match snapshot for e2e test: realWorld.jsonschema.js
`/* tslint:disable */␊
/**␊
* This file was automatically generated by json-schema-to-typescript.␊
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,␊
* and run json-schema-to-typescript to regenerate this file.␊
*/␊
export type CoreSchemaMetaSchema = CoreSchemaMetaSchema1 & CoreSchemaMetaSchema2;␊
export type NonNegativeInteger = number;␊
export type NonNegativeIntegerDefault0 = NonNegativeInteger;␊
export type CoreSchemaMetaSchema2 =␊
| {␊
$id?: string;␊
$schema?: string;␊
$ref?: string;␊
$comment?: string;␊
title?: string;␊
description?: string;␊
default?: true;␊
readOnly?: boolean;␊
writeOnly?: boolean;␊
examples?: true[];␊
multipleOf?: number;␊
maximum?: number;␊
exclusiveMaximum?: number;␊
minimum?: number;␊
exclusiveMinimum?: number;␊
maxLength?: NonNegativeInteger;␊
minLength?: NonNegativeIntegerDefault0;␊
pattern?: string;␊
additionalItems?: CoreSchemaMetaSchema2;␊
items?: CoreSchemaMetaSchema2 | SchemaArray;␊
maxItems?: NonNegativeInteger;␊
minItems?: NonNegativeIntegerDefault0;␊
uniqueItems?: boolean;␊
contains?: CoreSchemaMetaSchema2;␊
maxProperties?: NonNegativeInteger;␊
minProperties?: NonNegativeIntegerDefault0;␊
required?: StringArray;␊
additionalProperties?: CoreSchemaMetaSchema2;␊
definitions?: {␊
[k: string]: CoreSchemaMetaSchema2;␊
};␊
properties?: {␊
[k: string]: CoreSchemaMetaSchema2;␊
};␊
patternProperties?: {␊
[k: string]: CoreSchemaMetaSchema2;␊
};␊
dependencies?: {␊
[k: string]: CoreSchemaMetaSchema2 | StringArray;␊
};␊
propertyNames?: CoreSchemaMetaSchema2;␊
const?: true;␊
enum?: [true, ...unknown[]];␊
type?: SimpleTypes | [SimpleTypes, ...SimpleTypes[]];␊
format?: string;␊
contentMediaType?: string;␊
contentEncoding?: string;␊
if?: CoreSchemaMetaSchema2;␊
then?: CoreSchemaMetaSchema2;␊
else?: CoreSchemaMetaSchema2;␊
allOf?: SchemaArray;␊
anyOf?: SchemaArray;␊
oneOf?: SchemaArray;␊
not?: CoreSchemaMetaSchema2;␊
[k: string]: unknown;␊
}␊
| boolean;␊
export type SchemaArray = [CoreSchemaMetaSchema2, ...CoreSchemaMetaSchema2[]];␊
export type StringArray = string[];␊
export type SimpleTypes = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string";␊
export interface CoreSchemaMetaSchema1 {␊
$id?: string;␊
$schema?: string;␊
$ref?: string;␊
$comment?: string;␊
title?: string;␊
description?: string;␊
default?: true;␊
readOnly?: boolean;␊
writeOnly?: boolean;␊
examples?: true[];␊
multipleOf?: number;␊
maximum?: number;␊
exclusiveMaximum?: number;␊
minimum?: number;␊
exclusiveMinimum?: number;␊
maxLength?: NonNegativeInteger;␊
minLength?: NonNegativeIntegerDefault0;␊
pattern?: string;␊
additionalItems?: CoreSchemaMetaSchema2;␊
items?: CoreSchemaMetaSchema2 | SchemaArray;␊
maxItems?: NonNegativeInteger;␊
minItems?: NonNegativeIntegerDefault0;␊
uniqueItems?: boolean;␊
contains?: CoreSchemaMetaSchema2;␊
maxProperties?: NonNegativeInteger;␊
minProperties?: NonNegativeIntegerDefault0;␊
required?: StringArray;␊
additionalProperties?: CoreSchemaMetaSchema2;␊
definitions?: {␊
[k: string]: CoreSchemaMetaSchema2;␊
};␊
properties?: {␊
[k: string]: CoreSchemaMetaSchema2;␊
};␊
patternProperties?: {␊
[k: string]: CoreSchemaMetaSchema2;␊
};␊
dependencies?: {␊
[k: string]: CoreSchemaMetaSchema2 | StringArray;␊
};␊
propertyNames?: CoreSchemaMetaSchema2;␊
const?: true;␊
enum?: [true, ...unknown[]];␊
type?: SimpleTypes | [SimpleTypes, ...SimpleTypes[]];␊
format?: string;␊
contentMediaType?: string;␊
contentEncoding?: string;␊
if?: CoreSchemaMetaSchema2;␊
then?: CoreSchemaMetaSchema2;␊
else?: CoreSchemaMetaSchema2;␊
allOf?: SchemaArray;␊
anyOf?: SchemaArray;␊
oneOf?: SchemaArray;␊
not?: CoreSchemaMetaSchema2;␊
[k: string]: unknown;␊
}␊
`

## realWorld.openapi.js

> Expected output to match snapshot for e2e test: realWorld.openapi.js
Expand Down Expand Up @@ -8314,6 +8450,17 @@ Generated by [AVA](https://avajs.dev).
"required": []␊
}`

## Normalize empty const to singleton enum

> Snapshot 1
`{␊
"id": "foo",␊
"enum": [␊
""␊
]␊
}`

## Non object items.items

> Snapshot 1
Expand Down Expand Up @@ -8874,150 +9021,3 @@ Generated by [AVA](https://avajs.dev).
"additionalProperties": false,␊
"required": []␊
}`

## realWorld.jsonschema.js

> Expected output to match snapshot for e2e test: realWorld.jsonschema.js
`/* tslint:disable */␊
/**␊
* This file was automatically generated by json-schema-to-typescript.␊
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,␊
* and run json-schema-to-typescript to regenerate this file.␊
*/␊
export type CoreSchemaMetaSchema = CoreSchemaMetaSchema1 & CoreSchemaMetaSchema2;␊
export type NonNegativeInteger = number;␊
export type NonNegativeIntegerDefault0 = NonNegativeInteger;␊
export type CoreSchemaMetaSchema2 =␊
| {␊
$id?: string;␊
$schema?: string;␊
$ref?: string;␊
$comment?: string;␊
title?: string;␊
description?: string;␊
default?: true;␊
readOnly?: boolean;␊
writeOnly?: boolean;␊
examples?: true[];␊
multipleOf?: number;␊
maximum?: number;␊
exclusiveMaximum?: number;␊
minimum?: number;␊
exclusiveMinimum?: number;␊
maxLength?: NonNegativeInteger;␊
minLength?: NonNegativeIntegerDefault0;␊
pattern?: string;␊
additionalItems?: CoreSchemaMetaSchema2;␊
items?: CoreSchemaMetaSchema2 | SchemaArray;␊
maxItems?: NonNegativeInteger;␊
minItems?: NonNegativeIntegerDefault0;␊
uniqueItems?: boolean;␊
contains?: CoreSchemaMetaSchema2;␊
maxProperties?: NonNegativeInteger;␊
minProperties?: NonNegativeIntegerDefault0;␊
required?: StringArray;␊
additionalProperties?: CoreSchemaMetaSchema2;␊
definitions?: {␊
[k: string]: CoreSchemaMetaSchema2;␊
};␊
properties?: {␊
[k: string]: CoreSchemaMetaSchema2;␊
};␊
patternProperties?: {␊
[k: string]: CoreSchemaMetaSchema2;␊
};␊
dependencies?: {␊
[k: string]: CoreSchemaMetaSchema2 | StringArray;␊
};␊
propertyNames?: CoreSchemaMetaSchema2;␊
const?: true;␊
enum?: [true, ...unknown[]];␊
type?: SimpleTypes | [SimpleTypes, ...SimpleTypes[]];␊
format?: string;␊
contentMediaType?: string;␊
contentEncoding?: string;␊
if?: CoreSchemaMetaSchema2;␊
then?: CoreSchemaMetaSchema2;␊
else?: CoreSchemaMetaSchema2;␊
allOf?: SchemaArray;␊
anyOf?: SchemaArray;␊
oneOf?: SchemaArray;␊
not?: CoreSchemaMetaSchema2;␊
[k: string]: unknown;␊
}␊
| boolean;␊
export type SchemaArray = [CoreSchemaMetaSchema2, ...CoreSchemaMetaSchema2[]];␊
export type StringArray = string[];␊
export type SimpleTypes = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string";␊
export interface CoreSchemaMetaSchema1 {␊
$id?: string;␊
$schema?: string;␊
$ref?: string;␊
$comment?: string;␊
title?: string;␊
description?: string;␊
default?: true;␊
readOnly?: boolean;␊
writeOnly?: boolean;␊
examples?: true[];␊
multipleOf?: number;␊
maximum?: number;␊
exclusiveMaximum?: number;␊
minimum?: number;␊
exclusiveMinimum?: number;␊
maxLength?: NonNegativeInteger;␊
minLength?: NonNegativeIntegerDefault0;␊
pattern?: string;␊
additionalItems?: CoreSchemaMetaSchema2;␊
items?: CoreSchemaMetaSchema2 | SchemaArray;␊
maxItems?: NonNegativeInteger;␊
minItems?: NonNegativeIntegerDefault0;␊
uniqueItems?: boolean;␊
contains?: CoreSchemaMetaSchema2;␊
maxProperties?: NonNegativeInteger;␊
minProperties?: NonNegativeIntegerDefault0;␊
required?: StringArray;␊
additionalProperties?: CoreSchemaMetaSchema2;␊
definitions?: {␊
[k: string]: CoreSchemaMetaSchema2;␊
};␊
properties?: {␊
[k: string]: CoreSchemaMetaSchema2;␊
};␊
patternProperties?: {␊
[k: string]: CoreSchemaMetaSchema2;␊
};␊
dependencies?: {␊
[k: string]: CoreSchemaMetaSchema2 | StringArray;␊
};␊
propertyNames?: CoreSchemaMetaSchema2;␊
const?: true;␊
enum?: [true, ...unknown[]];␊
type?: SimpleTypes | [SimpleTypes, ...SimpleTypes[]];␊
format?: string;␊
contentMediaType?: string;␊
contentEncoding?: string;␊
if?: CoreSchemaMetaSchema2;␊
then?: CoreSchemaMetaSchema2;␊
else?: CoreSchemaMetaSchema2;␊
allOf?: SchemaArray;␊
anyOf?: SchemaArray;␊
oneOf?: SchemaArray;␊
not?: CoreSchemaMetaSchema2;␊
[k: string]: unknown;␊
}␊
`

## Normalize empty const to singleton enum

> Snapshot 1
`{␊
"id": "foo",␊
"enum": [␊
""␊
]␊
}`
Binary file modified test/__snapshots__/test/test.ts.snap
Binary file not shown.
33 changes: 23 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
# yarn lockfile v1


"@apidevtools/[email protected].6":
version "9.0.6"
resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.6.tgz#5d9000a3ac1fd25404da886da6b266adcd99cf1c"
integrity sha512-M3YgsLjI0lZxvrpeGVk9Ap032W6TPQkH6pRAZz81Ac3WUNF79VQooAFnp8umjvVzUmD93NkogxEwbSce7qMsUg==
"@apidevtools/[email protected].9":
version "9.0.9"
resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz#d720f9256e3609621280584f2b47ae165359268b"
integrity sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w==
dependencies:
"@jsdevtools/ono" "^7.1.3"
"@types/json-schema" "^7.0.6"
call-me-maybe "^1.0.1"
js-yaml "^3.13.1"
js-yaml "^4.1.0"

"@babel/code-frame@^7.0.0":
version "7.12.11"
Expand Down Expand Up @@ -393,6 +394,11 @@ argparse@^1.0.7:
dependencies:
sprintf-js "~1.0.2"

argparse@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==

array-filter@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83"
Expand Down Expand Up @@ -2322,6 +2328,13 @@ js-yaml@^3.10.0, js-yaml@^3.13.1:
argparse "^1.0.7"
esprima "^4.0.0"

js-yaml@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
dependencies:
argparse "^2.0.1"

[email protected]:
version "3.0.0"
resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898"
Expand All @@ -2337,12 +2350,12 @@ json-parse-even-better-errors@^2.3.0:
resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d"
integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==

json-schema-ref-parser@^9.0.6:
version "9.0.6"
resolved "https://registry.yarnpkg.com/json-schema-ref-parser/-/json-schema-ref-parser-9.0.6.tgz#fc89a5e6b853f2abe8c0af30d3874196526adb60"
integrity sha512-z0JGv7rRD3CnJbZY/qCpscyArdtLJhr/wRBmFUdoZ8xMjsFyNdILSprG2degqRLjBjyhZHAEBpGOxniO9rKTxA==
json-schema-ref-parser@^9.0.9:
version "9.0.9"
resolved "https://registry.yarnpkg.com/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz#66ea538e7450b12af342fa3d5b8458bc1e1e013f"
integrity sha512-qcP2lmGy+JUoQJ4DOQeLaZDqH9qSkeGCK3suKWxJXS82dg728Mn3j97azDMaOUmJAN4uCq91LdPx4K7E8F1a7Q==
dependencies:
"@apidevtools/json-schema-ref-parser" "9.0.6"
"@apidevtools/json-schema-ref-parser" "9.0.9"

json-schema-traverse@^0.4.1:
version "0.4.1"
Expand Down

0 comments on commit f943f32

Please sign in to comment.