[Koha-bugs] [Bug 16699] Swagger: Split parameters and paths, and specify required permissions for resource

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jun 14 12:48:07 CEST 2016


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16699

--- Comment #2 from Lari Taskula <larit at student.uef.fi> ---
Thanks for the interest! Unfortunately, I am having some issues with this
approach. The specifications won't validate through Swagger-UI validator
(online.swagger.io/validator/debug?url=url_to_your_swagger.json). I read a
little about the issue, and to my understanding the structure I described above
does not seem to meet Swagger2 specification. It seems that the Paths Object
does not take a $ref, but Path Item Object, which can take a $ref. This means
that we would not meet the Swagger2 specification if we attempted something
like this in swagger.json:

..
"paths": {
  "$ref": "paths/index.json"
},
..

In fact the same error happens when running the current master version (the
definitions/index.json in Bug 15126) against online.swagger.io-validator. This
is the error message I get with the online.swagger.io-validator:

{"messages":["attribute definitions.$ref is not of type
`object`"],"schemaValidationMessages":[{"level":"error","domain":"validation","keyword":"type","message":"instance
type (string) does not match any allowed primitive type (allowed:
[\"object\"])","schema":{"loadingURI":"http://swagger.io/v2/schema.json#","pointer":"/definitions/schema"},"instance":{"pointer":"/definitions/$ref"}}]}

An option would be to keep the proposed structure for development, and use the
minifySwagger.pl-script (Bug 16212) to have a valid Swagger specification in
the minified swagger.min.json.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list