json-schema-to-typescript
Advanced tools
Comparing version 1.2.1 to 1.2.2
{ | ||
"name": "json-schema-to-typescript", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "compile json schema to typescript typings", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -168,3 +168,8 @@ import { JSONSchema } from './JSONSchema' | ||
let type = this.createTsType(rule) | ||
type.id = type.id || rule.id || rule.title | ||
if (!type.id) { | ||
// the type is not declared, let's check if we should declare it or keep it inline | ||
type.id = rule.id || rule.title | ||
if (type.id) | ||
this.declareType(type, type.id, type.id) | ||
} | ||
type.description = type.description || rule.description | ||
@@ -171,0 +176,0 @@ return type |
@@ -150,3 +150,3 @@ import { camelCase, upperFirst } from 'lodash' | ||
decl += ';' | ||
if (settings.propertyDescription && _.type.description) | ||
if (settings.propertyDescription && _.type.description && !_.type.id) | ||
decl += ' // ' + _.type.description | ||
@@ -153,0 +153,0 @@ return decl |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
64140
27
1796