typescript-json-schema
Advanced tools
Comparing version
37
api.md
@@ -1260,2 +1260,25 @@ _Auto-generated file. Updated with NPM deploy. Update manually with 'yarn docs'._ | ||
## [prop-override](./test/programs/prop-override) | ||
```ts | ||
import type { ObjectId } from './third-party' | ||
export type MyObject = { | ||
/** | ||
* @TJS-type string | ||
* @description Overrides aliased type definition with this JSDoc if at least TJS-type annotation is present | ||
*/ | ||
_id: ObjectId | ||
} | ||
``` | ||
## [prop-override](./test/programs/prop-override) | ||
```ts | ||
// cannot modify with JSDoc because third-party sources | ||
export class ObjectId {} | ||
``` | ||
## [strict-null-checks](./test/programs/strict-null-checks) | ||
@@ -1334,2 +1357,16 @@ | ||
## [type-alias-or](./test/programs/type-alias-or) | ||
```ts | ||
interface A {} | ||
interface B {} | ||
type C = A | B; | ||
interface MyObject { | ||
c: C; | ||
} | ||
``` | ||
## [type-alias-schema-override](./test/programs/type-alias-schema-override) | ||
@@ -1336,0 +1373,0 @@ |
@@ -456,2 +456,5 @@ "use strict"; | ||
} | ||
else if (flags & ts.TypeFlags.ESSymbol) { | ||
definition.type = "symbol"; | ||
} | ||
else if (flags & ts.TypeFlags.Null) { | ||
@@ -887,2 +890,3 @@ definition.type = "null"; | ||
JsonSchemaGenerator.prototype.getTypeDefinition = function (typ, asRef, unionModifier, prop, reffedType, pairedSymbol) { | ||
var _a; | ||
if (asRef === void 0) { asRef = this.args.ref; } | ||
@@ -909,3 +913,3 @@ if (unionModifier === void 0) { unionModifier = "anyOf"; } | ||
this.parseCommentsIntoDefinition(prop, defs, others); | ||
if (defs.hasOwnProperty("ignore")) { | ||
if (defs.hasOwnProperty("ignore") || defs.hasOwnProperty("type")) { | ||
return defs; | ||
@@ -920,2 +924,5 @@ } | ||
this.tc.getIndexInfoOfType(typ, ts.IndexKind.Number) !== undefined)); | ||
if (isRawType && ((_a = typ.aliasSymbol) === null || _a === void 0 ? void 0 : _a.escapedName) && typ.types) { | ||
isRawType = false; | ||
} | ||
var isStringEnum = false; | ||
@@ -922,0 +929,0 @@ if (typ.flags & ts.TypeFlags.Union) { |
{ | ||
"name": "typescript-json-schema", | ||
"version": "0.54.0", | ||
"version": "0.55.0", | ||
"description": "typescript-json-schema generates JSON Schema files from your Typescript sources", | ||
@@ -49,4 +49,4 @@ "main": "dist/typescript-json-schema.js", | ||
"safe-stable-stringify": "^2.2.0", | ||
"ts-node": "^10.2.1", | ||
"typescript": "~4.6.0", | ||
"ts-node": "^10.9.1", | ||
"typescript": "~4.8.2", | ||
"yargs": "^17.1.1" | ||
@@ -53,0 +53,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
235040
0.64%3336
0.39%+ Added
- Removed
Updated
Updated