apigee-127 / sway

A library that simplifies OpenAPI (fka Swagger) integrations/tooling.
MIT License
190 stars 92 forks source link

Not able to validate 'URL' fields in swagger specification like tokenURL #197

Open arpitgarg1 opened 5 years ago

arpitgarg1 commented 5 years ago

In swagger spec, attributes with URI as value instead of URL not giving any validation error/warnings. For example tokenURL in securitydefinitions requires 'URL' as per OAS 2.0 standards. But providing URI, sway library not throwing any errors. Although the appropriate error, receive in swagger editor through manual upload of same swagger spec. securityDefinitions: ios: type: oauth2 tokenUrl: /oauth/token

No error comes with the above example using sway library for validation. Refer: OAS 2.0 documentation link. See 'tokenURL' description.

Please fix this validation in code. And this error needs to be fixed for every URL property.

whitlockjc commented 5 years ago

This is new to me, I would expect the JSON Schema from the OAS to catch this. Let me do some digging and we'll get to the bottom of it.