typescript-rest-swagger-plural
Advanced tools
Comparing version 0.0.35 to 0.0.36
@@ -15,3 +15,3 @@ export interface Config { | ||
*/ | ||
operationNameMethodOnly: boolean; | ||
operationNameMethodOnly?: boolean; | ||
/** | ||
@@ -92,2 +92,8 @@ * Generated SwaggerConfig.json will output here | ||
/** | ||
* Shorten qualified type names to their rightmost identity. | ||
* i.e. | ||
* "Module.Type" -> "Type" | ||
*/ | ||
shortTypeNames?: boolean; | ||
/** | ||
* Default collectionFormat property for query parameters of array type. | ||
@@ -94,0 +100,0 @@ * Possible values are `csv`, `ssv`, `tsv`, `pipes`, `multi`. If not specified, Swagger defaults to `csv`. |
@@ -17,2 +17,5 @@ "use strict"; | ||
var _this = this; | ||
//TODO: bit of a hack | ||
if (this.config.shortTypeNames) | ||
global.shortTypeNames = this.config.shortTypeNames; | ||
this.program.getSourceFiles().forEach(function (sf) { | ||
@@ -19,0 +22,0 @@ ts.forEachChild(sf, function (node) { |
@@ -260,3 +260,9 @@ "use strict"; | ||
var qualifiedType = type; | ||
return resolveFqTypeName(qualifiedType.left) + '.' + qualifiedType.right.text; | ||
if (global.shortTypeNames) //TODO: bit of a hack | ||
{ | ||
return qualifiedType.right.text; | ||
} | ||
else { | ||
return resolveFqTypeName(qualifiedType.left) + '.' + qualifiedType.right.text; | ||
} | ||
} | ||
@@ -263,0 +269,0 @@ function resolveSimpleTypeName(type) { |
{ | ||
"name": "typescript-rest-swagger-plural", | ||
"version": "0.0.35", | ||
"version": "0.0.36", | ||
"description": "Generate Swagger files from a typescript-rest project", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -19,3 +19,3 @@ 'use strict'; | ||
*/ | ||
operationNameMethodOnly: boolean; | ||
operationNameMethodOnly?: boolean; | ||
@@ -109,2 +109,9 @@ /** | ||
/** | ||
* Shorten qualified type names to their rightmost identity. | ||
* i.e. | ||
* "Module.Type" -> "Type" | ||
*/ | ||
shortTypeNames?: boolean; | ||
/** | ||
* Default collectionFormat property for query parameters of array type. | ||
@@ -111,0 +118,0 @@ * Possible values are `csv`, `ssv`, `tsv`, `pipes`, `multi`. If not specified, Swagger defaults to `csv`. |
@@ -20,2 +20,6 @@ import * as ts from 'typescript'; | ||
public generate(): Metadata { | ||
//TODO: bit of a hack | ||
if (this.config.shortTypeNames) | ||
(<any>global).shortTypeNames = this.config.shortTypeNames; | ||
this.program.getSourceFiles().forEach(sf => { | ||
@@ -22,0 +26,0 @@ ts.forEachChild(sf, node => { |
@@ -277,3 +277,10 @@ import * as ts from 'typescript'; | ||
const qualifiedType = type as ts.QualifiedName; | ||
return resolveFqTypeName(qualifiedType.left) + '.' + (qualifiedType.right as ts.Identifier).text; | ||
if ((<any>global).shortTypeNames) //TODO: bit of a hack | ||
{ | ||
return (qualifiedType.right as ts.Identifier).text; | ||
} | ||
else | ||
{ | ||
return resolveFqTypeName(qualifiedType.left) + '.' + (qualifiedType.right as ts.Identifier).text; | ||
} | ||
} | ||
@@ -280,0 +287,0 @@ |
Sorry, the diff of this file is not supported yet
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
299525
5291