open311 / swagger-open311

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

Indefinite Field type for service_code and service_request_id #23

Open seekayel opened 8 years ago

seekayel commented 8 years ago

Summary The spec is internally inconsistent in what JSON type it uses in its service_code and service_request_id examples. These examples don't match the type: string definition for this swagger spec.

Proposed solution: change them all to string types or change them all to integer types and clearly state the type in the spec.

TL;DR The swagger spec specifies service_request_id and service_code as

service_code:
  type: string
  format: uid
service_request_id:
  type: string
  format: uid

Which would imply the following formats:

JSON

"service_request_id": "1335131"
"service_code": "124"

XML

<service_request_id>1335131</service_request_id>
<service_code>124</service_code>

The XML can be interpreted as either a string or an integer. Note that the spec (http://wiki.open311.org/GeoReport_v2/) defines it in its sample JSON in both ways.

Get Service List: "service_code":001 Get Service Definition: "service_code":"DMV66"

For service_request_id it is only specified in the json integer format "service_request_id":293944 this would imply that the service_request_id field is actually an Integer and not a string.

cc @zdicesare @philipashlock

kvlahromei commented 8 years ago

Hi @seekayel , thanks for submitting this issue and sorry for the delay. I will check it this week