SmartBear / readyapi-swagger-plugin

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

Endpoint is not picked from the swagger definition(2.0) #11

Open jranabahu opened 9 years ago

jranabahu commented 9 years ago

I've used the petstore-expanded.json[1] in swagger samples and the endpoint value is not set in the default request. The reason for this is that the code assumes that the "basePath" contains the host name where the API is served. While this is true for the swagger 1.2 spec, in swagger 2.0 spec the "basePath" is relative to the "host" field.

If the swagger definition has a "host" field, then the endpoint should be picked from that field.

Thanks, Janaka

[1] https://raw.githubusercontent.com/swagger-api/swagger-spec/master/examples/v2.0/json/petstore-expanded.json