SmartBear / readyapi-swagger-plugin

Ready! API Plugin for importing Swagger definitions as REST Services
36 stars 27 forks source link

Responses are not validated against swagger definition #54

Open flounderpinto opened 7 years ago

flounderpinto commented 7 years ago

Responses are not properly validated against the provided swagger definition.

To reproduce, create a swagger definition with an 'integer' field. Create a response with a non-integer response. Validation will not fail. Additionally, invalid tags will also not cause a failure. Actually, I can't find a way to make the validation fail at all.

It appears (in ValidationSupport::validateMessage() ) that a JSON schema validation is being performed and not a swagger validation. By reading the warnings generated, the schema validation reports a warning on all swagger keywords ("swagger", "host", "schemes", etc...).

olensmar commented 7 years ago

thanks - looking into it!

flounderpinto commented 7 years ago

Sorry for the nag, but any update on this? We just really need this to work before moving forward with SoapUI.

olensmar commented 7 years ago

hm... the code looks ok to me - can you share an example swagger and message payload that should fail (or not) ?

olensmar commented 7 years ago

@flounder5 ping?

garysole commented 6 years ago

Old but was this ever fixed. Have the same issue. Looks like it only does a valid JSON, but does not confirm that the response matches the Swagger Specification. Specifically change the response to cause a fault. Did not fail. Was able to discover a fail based on an incorrect type (Integer vs Double). But it is not validating that the field name is correct. Currently doing trial of ReadyAPI - this is the highest priority capability we want in the product. Without this, ReadyAPI does not fit our needs.