Skip to content

Commit

Permalink
fix: do not ignore path level parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Dec 7, 2017
1 parent d27ba74 commit 14f8408
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion demo/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ x-tagGroups:
paths:
/pet:
parameters:
- name: pathParam
- name: cookieParam
in: cookie
description: Some cookie
required: true
Expand Down
4 changes: 2 additions & 2 deletions src/services/MenuBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down Expand Up @@ -193,7 +193,7 @@ export class MenuBuilder {
...operationInfo,
_$ref: operationPointer,
httpVerb: operationName,
pathParams: path.parameters || [],
pathParameters: path.parameters || [],
});
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/services/models/Operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 || [])
Expand Down

0 comments on commit 14f8408

Please sign in to comment.