open311 / swagger-open311

An swagger definition of Open311 GeoReport API
4 stars 8 forks source link

Service discovery -> response_format #12

Open kvlahromei opened 9 years ago

kvlahromei commented 9 years ago

Our current spec say that JSON is optional and need to be checked via service discovery.

How can underline this problem and make it somewhat formal/machine readabe?

philipashlock commented 9 years ago

Whether an endpoint supports JSON is machine readable as specified in the service discovery file, but this isn't always implemented and it's quite decoupled from the endpoint itself. One approach to doing validation would be to have one Swagger definition for XML and one for JSON and test them separately. Then you'd start by looking for the service discovery file, default to testing it against the XML Swagger definition and then if JSON is specified in the service discovery file, test it against the JSON Swagger definition.