mirror of
https://github.com/ferdikoomen/openapi-typescript-codegen.git
synced 2025-12-08 20:16:21 +00:00
- Small fix for anyOf without a "type": "object" property
This commit is contained in:
parent
aa82bc97ba
commit
19fc49b590
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "openapi-typescript-codegen",
|
||||
"version": "0.4.6",
|
||||
"version": "0.4.7",
|
||||
"description": "NodeJS library that generates Typescript or Javascript clients based on the OpenAPI specification.",
|
||||
"author": "Ferdi Koomen",
|
||||
"homepage": "https://github.com/ferdikoomen/openapi-typescript-codegen",
|
||||
|
||||
@ -120,12 +120,12 @@ export function getModel(openApi: OpenApi, definition: OpenApiSchema, isDefiniti
|
||||
}
|
||||
}
|
||||
|
||||
if (definition.type === 'object') {
|
||||
if (definition.type === 'object' || definition.allOf) {
|
||||
model.export = 'interface';
|
||||
model.type = PrimaryType.OBJECT;
|
||||
model.base = PrimaryType.OBJECT;
|
||||
|
||||
if (definition.allOf) {
|
||||
if (definition.allOf && definition.allOf.length) {
|
||||
definition.allOf.forEach(parent => {
|
||||
if (parent.$ref) {
|
||||
const parentRef = getType(parent.$ref);
|
||||
|
||||
@ -143,13 +143,13 @@ export function getModel(openApi: OpenApi, definition: OpenApiSchema, isDefiniti
|
||||
return model;
|
||||
}
|
||||
|
||||
if (definition.type === 'object') {
|
||||
if (definition.type === 'object' || definition.allOf) {
|
||||
model.export = 'interface';
|
||||
model.type = PrimaryType.OBJECT;
|
||||
model.base = PrimaryType.OBJECT;
|
||||
model.default = getModelDefault(definition, model);
|
||||
|
||||
if (definition.allOf) {
|
||||
if (definition.allOf && definition.allOf.length) {
|
||||
definition.allOf.forEach(parent => {
|
||||
if (parent.$ref) {
|
||||
const parentRef = getType(parent.$ref);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user