Merge pull request #1454 from kraenhansen/parameter-components

Parameter components
This commit is contained in:
Ferdi Koomen 2023-04-11 08:34:27 +02:00 committed by GitHub
commit 78354d586a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -15,6 +15,19 @@ export const getModels = (openApi: OpenApi): Model[] => {
models.push(model);
}
}
for (const definitionName in openApi.components.parameters) {
if (openApi.components.parameters.hasOwnProperty(definitionName)) {
const definition = openApi.components.parameters[definitionName];
const definitionType = getType(definitionName);
const schema = definition.schema;
if (schema) {
const model = getModel(openApi, schema, true, definitionType.base.replace(reservedWords, '_$1'));
model.description = definition.description || null;
model.deprecated = definition.deprecated;
models.push(model);
}
}
}
}
return models;
};

View File

@ -4907,7 +4907,6 @@ export type SimpleInteger = number;
"
`;
exports[`v3 should generate: test/generated/v3/models/SimpleReference.ts 1`] = `
"/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */