typescript-json-schema
Advanced tools
Comparing version 0.0.7 to 0.0.8
{ | ||
"name": "typescript-json-schema", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "typescript-json-schema generates JSON Schema files from your Typescript sources", | ||
@@ -5,0 +5,0 @@ "main": "typescript-json-schema.js", |
@@ -1,4 +0,4 @@ | ||
interface MyObject { | ||
export interface MyObject { | ||
propA: number; | ||
propB: number; | ||
} |
@@ -352,2 +352,3 @@ "use strict"; | ||
var fullName_1 = tc.getFullyQualifiedName(node.symbol); | ||
fullName_1 = fullName_1.replace(/".*"\./, ""); | ||
allSymbols_1[fullName_1] = nodeType; | ||
@@ -435,3 +436,3 @@ var baseTypes = nodeType.getBaseTypes() || []; | ||
usePropertyOrder: args.propOrder, | ||
generateRequired: args.generateRequired | ||
generateRequired: args.required | ||
}); | ||
@@ -438,0 +439,0 @@ } |
@@ -418,3 +418,11 @@ import * as ts from "typescript"; | ||
const nodeType = tc.getTypeAtLocation(node); | ||
const fullName = tc.getFullyQualifiedName((<any>node).symbol) | ||
let fullName = tc.getFullyQualifiedName((<any>node).symbol) | ||
// remove file name | ||
// TODO: we probably don't want this eventually, | ||
// as same types can occur in different files and will override eachother in allSymbols | ||
// This means atm we can't generate all types in large programs. | ||
fullName = fullName.replace(/".*"\./, ""); | ||
allSymbols[fullName] = nodeType; | ||
@@ -507,3 +515,3 @@ | ||
usePropertyOrder: args.propOrder, | ||
generateRequired: args.generateRequired | ||
generateRequired: args.required | ||
}); | ||
@@ -518,3 +526,3 @@ } | ||
//TJS.exec("example/**/*.ts", "Invoice"); | ||
//const result = TJS.generateSchema(TJS.getProgramFromFiles(["test/programs/array-types/main.ts"]), "MyArray"); | ||
//const result = TJS.generateSchema(TJS.getProgramFromFiles(["test/programs/interface-single/main.ts"]), "MyObject"); | ||
//console.log(JSON.stringify(result)); |
Sorry, the diff of this file is not supported yet
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
241587
5338