As mentioned explicitly in the OpenAPI 2.0 spec, the 'swagger' attribute needs to be a 'string': """ Required. Specifies the Swagger Specification version being used. It can be used by the Swagger UI and other clients to interpret the API listing. The value MUST be "2.0". """ Out stack doesn't take that into account, but some validator will take our spec as having a number instead. A fix should be backported to all stable releases so we can use newer versions of redoc for the API docs.
Created attachment 123815 [details] [review] Bug 28848: Make sure the 'swagger' attribute is a string Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
I'm not sure how this should be tested. Just see "2.0" is wrapped in double quotes, which is what the spec expects as mentioned.
Created attachment 123818 [details] [review] Bug 28848: Make sure the 'swagger' attribute is a string Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com>
Testing notes (koha-testing-docker): 1. Go to https://editor.swagger.io/ 2. Load the api/v1/swagger/swagger.yaml file (File > Import file) 3. You should get this message: Unable to render this definition The provided definition does not specify a valid version field. Please indicate a valid Swagger or OpenAPI version field. Supported version fields are swagger: "2.0" and those that match openapi: 3.0.n (for example, openapi: 3.0.0). 4. Apply the patch 5. Repeat steps 1-2 6. The file should now load
Created attachment 123823 [details] [review] Bug 28848: Make sure the 'swagger' attribute is a string Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Obvious fix.. PQA
Pushed to master for 21.11, thanks to everybody involved!