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: paths:
/pet: /pet:
parameters: parameters:
- name: pathParam - name: cookieParam
in: cookie in: cookie
description: Some cookie description: Some cookie
required: true required: true

View File

@ -13,7 +13,7 @@ export type TagInfo = OpenAPITag & {
export type ExtendedOpenAPIOperation = { export type ExtendedOpenAPIOperation = {
_$ref: string; _$ref: string;
httpVerb: string; httpVerb: string;
pathParams: Referenced<OpenAPIParameter>[]; pathParameters: Referenced<OpenAPIParameter>[];
} & OpenAPIOperation; } & OpenAPIOperation;
export type TagsInfoMap = Dict<TagInfo>; export type TagsInfoMap = Dict<TagInfo>;
@ -193,7 +193,7 @@ export class MenuBuilder {
...operationInfo, ...operationInfo,
_$ref: operationPointer, _$ref: operationPointer,
httpVerb: operationName, 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.codeSamples = operationSpec['x-code-samples'] || [];
this.path = JsonPointer.baseName(this._$ref, 2); this.path = JsonPointer.baseName(this._$ref, 2);
this.parameters = (operationSpec.parameters || []).map( this.parameters = operationSpec.pathParameters
paramOrRef => new FieldModel(parser, paramOrRef, this._$ref, options), .concat(operationSpec.parameters || [])
); .map(paramOrRef => new FieldModel(parser, paramOrRef, this._$ref, options));
let hasSuccessResponses = false; let hasSuccessResponses = false;
this.responses = Object.keys(operationSpec.responses || []) this.responses = Object.keys(operationSpec.responses || [])