mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Change validation input when version is 3.1.x
if the option includeWebhooks is false and there are no paths (only webhooks or componentes) throw error.
This commit is contained in:
@@ -10,10 +10,11 @@ module.exports = {
|
||||
* Parses an OAS string/object as a YAML or JSON
|
||||
* @param {YAML/JSON} openApiSpec - The OAS 3.x specification specified in either YAML or JSON
|
||||
* @param {object} inputValidation - Concrete validator according to version
|
||||
* @param {Object} options computed process options
|
||||
* @returns {Object} - Contains the parsed JSON-version of the OAS spec, or an error
|
||||
* @no-unit-test
|
||||
*/
|
||||
parseSpec: function (openApiSpec, inputValidation) {
|
||||
parseSpec: function (openApiSpec, inputValidation, options) {
|
||||
var openApiObj = openApiSpec,
|
||||
obj,
|
||||
rootValidation;
|
||||
@@ -32,7 +33,7 @@ module.exports = {
|
||||
// spec is a valid JSON object at this point
|
||||
|
||||
// Validate the root level object for semantics
|
||||
rootValidation = inputValidation.validateSpec(openApiObj);
|
||||
rootValidation = inputValidation.validateSpec(openApiObj, options);
|
||||
if (!rootValidation.result) {
|
||||
return {
|
||||
result: false,
|
||||
|
||||
Reference in New Issue
Block a user