-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from trimble-oss/api-standards-enforcement-ref…
…ined-rules Addressed the PR issues reported
- Loading branch information
Showing
5 changed files
with
114 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
module.exports = (input) => { | ||
if (!input["responses"]) { | ||
let keys = Object.keys(input) | ||
let extraFields = ['parameters', 'servers', 'summary', 'description', '$ref'] | ||
let httpVerbs = keys.filter((verb) => !(extraFields.includes(verb))); | ||
for(let index = 0; index < httpVerbs.length; index++) | ||
{ | ||
if (!input[httpVerbs[index]]["responses"]) { | ||
return [ | ||
{ | ||
message: "Response body missing for the given request.", | ||
}, | ||
]; | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters