-
-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There had been a bug that `Date | null` type being considered as non nullable type when generating JSON schema. This PR fixes the bug, so that no problem would be occured more.
- Loading branch information
Showing
88 changed files
with
6,265 additions
and
368 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ node_modules/ | |
|
||
packages/typescript-json/src/ | ||
package-lock.json | ||
pnpm-lock.yaml | ||
|
||
*.log | ||
*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "typia", | ||
"version": "5.4.1", | ||
"version": "5.4.2", | ||
"description": "Superfast runtime validators with only one line", | ||
"main": "lib/index.js", | ||
"typings": "lib/index.d.ts", | ||
|
@@ -79,6 +79,7 @@ | |
"@types/ts-expose-internals": "npm:[email protected]", | ||
"@typescript-eslint/eslint-plugin": "^5.59.11", | ||
"@typescript-eslint/parser": "^5.59.11", | ||
"chalk": "^4.0.0", | ||
"prettier": "^2.6.2", | ||
"rimraf": "^5.0.5", | ||
"ts-node": "^10.9.1", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{ | ||
"schemas": [ | ||
{ | ||
"$ref": "#/components/schemas/ObjectDate" | ||
} | ||
], | ||
"components": { | ||
"schemas": { | ||
"ObjectDate": { | ||
"$id": "#/components/schemas/ObjectDate", | ||
"type": "object", | ||
"properties": { | ||
"classDate": { | ||
"oneOf": [ | ||
{ | ||
"type": "null" | ||
}, | ||
{ | ||
"type": "string", | ||
"format": "date-time" | ||
} | ||
] | ||
}, | ||
"date": { | ||
"oneOf": [ | ||
{ | ||
"type": "null" | ||
}, | ||
{ | ||
"type": "string", | ||
"format": "date" | ||
} | ||
] | ||
}, | ||
"datetime": { | ||
"oneOf": [ | ||
{ | ||
"type": "null" | ||
}, | ||
{ | ||
"type": "string", | ||
"format": "date-time" | ||
} | ||
] | ||
}, | ||
"time": { | ||
"oneOf": [ | ||
{ | ||
"type": "null" | ||
}, | ||
{ | ||
"type": "string", | ||
"format": "time" | ||
} | ||
] | ||
}, | ||
"duration": { | ||
"oneOf": [ | ||
{ | ||
"type": "null" | ||
}, | ||
{ | ||
"type": "string", | ||
"format": "duration" | ||
} | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"date", | ||
"datetime", | ||
"time", | ||
"duration" | ||
] | ||
} | ||
} | ||
}, | ||
"purpose": "ajv", | ||
"surplus": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
{ | ||
"schemas": [ | ||
{ | ||
"$ref": "#/components/schemas/ObjectDate" | ||
} | ||
], | ||
"components": { | ||
"schemas": { | ||
"ObjectDate": { | ||
"$id": "#/components/schemas/ObjectDate", | ||
"type": "object", | ||
"properties": { | ||
"classDate": { | ||
"oneOf": [ | ||
{ | ||
"x-typia-required": true, | ||
"x-typia-optional": true, | ||
"type": "null" | ||
}, | ||
{ | ||
"type": "string", | ||
"format": "date-time" | ||
} | ||
], | ||
"x-typia-required": true, | ||
"x-typia-optional": true | ||
}, | ||
"date": { | ||
"oneOf": [ | ||
{ | ||
"x-typia-required": true, | ||
"x-typia-optional": false, | ||
"type": "null" | ||
}, | ||
{ | ||
"type": "string", | ||
"format": "date", | ||
"x-typia-typeTags": [ | ||
{ | ||
"target": "string", | ||
"name": "Format<\"date\">", | ||
"kind": "format", | ||
"value": "date", | ||
"validate": "/^(\\d{4})-(\\d{2})-(\\d{2})$/.test($input)", | ||
"exclusive": [ | ||
"format", | ||
"pattern" | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"x-typia-required": true, | ||
"x-typia-optional": false | ||
}, | ||
"datetime": { | ||
"oneOf": [ | ||
{ | ||
"x-typia-required": true, | ||
"x-typia-optional": false, | ||
"type": "null" | ||
}, | ||
{ | ||
"type": "string", | ||
"format": "date-time", | ||
"x-typia-typeTags": [ | ||
{ | ||
"target": "string", | ||
"name": "Format<\"date-time\">", | ||
"kind": "format", | ||
"value": "date-time", | ||
"validate": "!isNaN(new Date($input).getTime())", | ||
"exclusive": [ | ||
"format", | ||
"pattern" | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"x-typia-required": true, | ||
"x-typia-optional": false | ||
}, | ||
"time": { | ||
"oneOf": [ | ||
{ | ||
"x-typia-required": true, | ||
"x-typia-optional": false, | ||
"type": "null" | ||
}, | ||
{ | ||
"type": "string", | ||
"format": "time", | ||
"x-typia-typeTags": [ | ||
{ | ||
"target": "string", | ||
"name": "Format<\"time\">", | ||
"kind": "format", | ||
"value": "time", | ||
"validate": "/^(\\d\\d):(\\d\\d):(\\d\\d(?:\\.\\d+)?)(z|([+-])(\\d\\d)(?::?(\\d\\d))?)?$/i.test($input)", | ||
"exclusive": [ | ||
"format", | ||
"pattern" | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"x-typia-required": true, | ||
"x-typia-optional": false | ||
}, | ||
"duration": { | ||
"oneOf": [ | ||
{ | ||
"x-typia-required": true, | ||
"x-typia-optional": false, | ||
"type": "null" | ||
}, | ||
{ | ||
"type": "string", | ||
"format": "duration", | ||
"x-typia-typeTags": [ | ||
{ | ||
"target": "string", | ||
"name": "Format<\"duration\">", | ||
"kind": "format", | ||
"value": "duration", | ||
"validate": "/^P(?!$)((\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?|(\\d+W)?)$/.test($input)", | ||
"exclusive": [ | ||
"format", | ||
"pattern" | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"x-typia-required": true, | ||
"x-typia-optional": false | ||
} | ||
}, | ||
"required": [ | ||
"date", | ||
"datetime", | ||
"time", | ||
"duration" | ||
], | ||
"x-typia-jsDocTags": [] | ||
} | ||
} | ||
}, | ||
"purpose": "ajv", | ||
"surplus": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"schemas": [ | ||
{ | ||
"$ref": "#/components/schemas/ObjectDate" | ||
} | ||
], | ||
"components": { | ||
"schemas": { | ||
"ObjectDate": { | ||
"type": "object", | ||
"properties": { | ||
"classDate": { | ||
"type": "string", | ||
"format": "date-time", | ||
"nullable": true | ||
}, | ||
"date": { | ||
"type": "string", | ||
"format": "date", | ||
"nullable": true | ||
}, | ||
"datetime": { | ||
"type": "string", | ||
"format": "date-time", | ||
"nullable": true | ||
}, | ||
"time": { | ||
"type": "string", | ||
"format": "time", | ||
"nullable": true | ||
}, | ||
"duration": { | ||
"type": "string", | ||
"format": "duration", | ||
"nullable": true | ||
} | ||
}, | ||
"nullable": false, | ||
"required": [ | ||
"date", | ||
"datetime", | ||
"time", | ||
"duration" | ||
] | ||
} | ||
} | ||
}, | ||
"purpose": "swagger", | ||
"surplus": false | ||
} |
Oops, something went wrong.