fix: do not ignore path level parameters

This commit is contained in:
Roman Hotsiy 2017-12-07 17:16:47 +02:00
parent d27ba74679
commit 14f8408e8d
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
3 changed files with 6 additions and 6 deletions

View File

@ -102,7 +102,7 @@ x-tagGroups:
paths:
/pet:
parameters:
- name: pathParam
- name: cookieParam
in: cookie
description: Some cookie
required: true

View File

@ -13,7 +13,7 @@ export type TagInfo = OpenAPITag & {
export type ExtendedOpenAPIOperation = {
_$ref: string;
httpVerb: string;
pathParams: Referenced<OpenAPIParameter>[];
pathParameters: Referenced<OpenAPIParameter>[];
} & OpenAPIOperation;
export type TagsInfoMap = Dict<TagInfo>;
@ -193,7 +193,7 @@ export class MenuBuilder {
...operationInfo,
_$ref: operationPointer,
httpVerb: operationName,
pathParams: path.parameters || [],
pathParameters: path.parameters || [],
});
}
}

View File

@ -75,9 +75,9 @@ export class OperationModel implements IMenuItem {
this.codeSamples = operationSpec['x-code-samples'] || [];
this.path = JsonPointer.baseName(this._$ref, 2);
this.parameters = (operationSpec.parameters || []).map(
paramOrRef => new FieldModel(parser, paramOrRef, this._$ref, options),
);
this.parameters = operationSpec.pathParameters
.concat(operationSpec.parameters || [])
.map(paramOrRef => new FieldModel(parser, paramOrRef, this._$ref, options));
let hasSuccessResponses = false;
this.responses = Object.keys(operationSpec.responses || [])