I ran some compliance issues which can be fixed in the examples section (how to use cowboy-swagger), or in the code itself (what cowboy-swagger generates).
- in the info object
version of the api is required (there should be some generated version in default)
- swagger editor [1] also complained about the missing
basePath. Even when I specified basePath in the app.config I didn't see in the json, probably it didn't pick up the value.
- a
path parameter needs a type field (it seems to be required), it can be string or number see spec [2]. format which is optional but in numeric cases would be good to see an example.
- when
responses are needed, it needs at least:
"responses": {
"default": {
"description": ""
}
}
but one can specify schema per http response code. See links below [2].
- For
body parameters I needed to define a "schema": {} at least, in order that the JSON would be compliant. required is not required here, type is forbidden.
I didn't have time to discover all parts of schema, but it would be a good example how to define request bodies which conform to a json.
[1] http://editor.swagger.io/#/
[2] http://swagger.io/specification/
I ran some compliance issues which can be fixed in the examples section (how to use cowboy-swagger), or in the code itself (what cowboy-swagger generates).
versionof the api is required (there should be some generated version in default)basePath. Even when I specifiedbasePathin theapp.configI didn't see in the json, probably it didn't pick up the value.pathparameter needs atypefield (it seems to be required), it can bestringornumbersee spec [2].formatwhich is optional but in numeric cases would be good to see an example.responsesare needed, it needs at least:but one can specify
schemaper http response code. See links below [2].bodyparameters I needed to define a"schema": {}at least, in order that the JSON would be compliant.requiredis not required here,typeis forbidden.I didn't have time to discover all parts of schema, but it would be a good example how to define request bodies which conform to a json.
[1] http://editor.swagger.io/#/
[2] http://swagger.io/specification/