Skip to content

Commit

Permalink
Merge pull request #16 from stream-monkey/feature/fix-request-model
Browse files Browse the repository at this point in the history
Added fix for if no request body or parameters
  • Loading branch information
brendo authored Jan 18, 2018
2 parents f430f5d + 9a4371b commit 630b399
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/DefinitionGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,14 @@ export class DefinitionGenerator {
operationObj.deprecated = true;
}

operationObj.parameters = this.getParametersFromConfig(documentationConfig);
operationObj.requestBody = this.getRequestBodiesFromConfig(documentationConfig);
if (operationObj.requestBody) {
operationObj.requestBody = this.getRequestBodiesFromConfig(documentationConfig);
}

if (operationObj.parameters) {
operationObj.parameters = this.getParametersFromConfig(documentationConfig);
}

operationObj.responses = this.getResponsesFromConfig(documentationConfig);

return operationObj;
Expand Down

0 comments on commit 630b399

Please sign in to comment.