Skip to content

Commit 2958124

Browse files
committed
Added parsing of parameter components
1 parent c8cf2ec commit 2958124

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/openApi/v3/parser/getModels.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@ export const getModels = (openApi: OpenApi): Model[] => {
1515
models.push(model);
1616
}
1717
}
18+
for (const definitionName in openApi.components.parameters) {
19+
if (openApi.components.parameters.hasOwnProperty(definitionName)) {
20+
const definition = openApi.components.parameters[definitionName];
21+
const definitionType = getType(definitionName);
22+
const schema = definition.schema;
23+
if (schema) {
24+
const model = getModel(openApi, schema, true, definitionType.base.replace(reservedWords, '_$1'));
25+
model.description = definition.description || null;
26+
model.deprecated = definition.deprecated;
27+
models.push(model);
28+
}
29+
}
30+
}
1831
}
1932
return models;
2033
};

0 commit comments

Comments
 (0)