openapi-codegen-typescript
Advanced tools
Comparing version 0.1.11 to 0.1.12
@@ -0,1 +1,13 @@ | ||
# v0.1.12 (Thu Sep 03 2020) | ||
#### 🐛 Bug Fix | ||
- fix(dictionary): fix codegen for object "dictionary" [#15](https://github.com/LandrAudio/openapi-codegen-typescript/pull/15) ([@nemrosim](https://github.com/nemrosim)) | ||
#### Authors: 1 | ||
- Artem Diashkin ([@nemrosim](https://github.com/nemrosim)) | ||
--- | ||
# v0.1.11 (Thu Sep 03 2020) | ||
@@ -2,0 +14,0 @@ |
@@ -157,2 +157,3 @@ "use strict"; | ||
var additionalSchema = DTOs[additionalRef]; | ||
// Enum key AND Enum value | ||
if (dicSchema && dicSchema.enum && additionalSchema && additionalSchema.enum) { | ||
@@ -166,2 +167,13 @@ var value_1 = "{ "; | ||
} | ||
// Enum key and Object value | ||
if (dicSchema && dicSchema.enum && additionalProperties) { | ||
var additionalRef_1 = MockGenerateHelper.parseRefType(additionalProperties[types_1.SwaggerProps.$ref].split('/')); | ||
var aOrAn_1 = indefinite_1.default(additionalRef_1, { articleOnly: true }); | ||
var value_2 = "{ "; | ||
dicSchema.enum.forEach(function (el) { | ||
value_2 += "\n\"" + el + "\": " + aOrAn_1 + additionalRef_1 + "API(),"; | ||
}); | ||
value_2 += "\n}"; | ||
return { propertyName: propertyName, value: value_2 }; | ||
} | ||
else { | ||
@@ -168,0 +180,0 @@ return { propertyName: propertyName, value: ' // TODO: Wrong dictionary type' }; |
@@ -155,3 +155,3 @@ "use strict"; | ||
var additionalRef = parseRefType(additionalProperties[types_1.SwaggerProps.$ref].split('/')); | ||
result += " " + propertyName + ": {\n[key in " + dictionaryRef + "]: " + additionalRef + "; \n }\n"; | ||
result += " " + propertyName + ": {\n[key in " + dictionaryRef + "]: " + additionalRef + "; \n }; \n"; | ||
} | ||
@@ -158,0 +158,0 @@ }); |
{ | ||
"name": "openapi-codegen-typescript", | ||
"version": "0.1.11", | ||
"version": "0.1.12", | ||
"description": "OpenApi codegen for generating types an mocks from swagger json file", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
59056
1115