New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
incorrect rendering of s/tuple and vector? #327
Comments
Hi, and thanks for the detailed setup! tupleAs Swagger doesn't support heterogeneous lists, the current implementation converts to "array of anything" (with full info as vendor extension), which renders poorly on the UI. If all the tuple-elements are of same type, we could use that as the type. Also, as it could set the vector?Does not contain type information and as the type is mandatory in Swagger (https://swagger.io/specification/#itemsObject), we have to use "anything", which is hope this helps. |
One more thing, Swagger supports setting examples and spec-tools allows any extra data to be passed in to the generated JSON Schema with spec records with (st/spec
{:spec (s/tuple int? int?)
:json-schema/example [0 0]}) |
hi @ikitommi, I am not very familiar with the code of spec-tools. I will see what I can do but cannot promise much to be honest. Hopefully it is an easy fix :) |
No worries and ping if you have time for this and need help. My link to the code is a good place to start and most likely, the only place you need to touch besides the tests for it. Spec-tools has good test coverage, so after changing the code, the tests should guide you to write new ones. The |
Closing this one, added issue to spec-tools for the improvement. |
Hey guys,
I am using the alpha-5 version of compojure-api with spec-tools 0.3.0. It is a great tool. Thanks so much for it.
I think I found a bug in the way the response object is displayed in swager. In our case we have two specs definitions that include a
s/tuple
and avector?
. In both cases they are rendered as[{}]
.In the case of a tuple, it should be rendered as
[0 0]
.In the case of
vector?
I think a simple[]
would suffice.Below are the specs definitions of the
tuple
andvector?
Here is a link to our swagger api. If you check the
model
tab you can also see that the elements that use the tuple and vector?, are rendered asinline-model-
, not with their respective model names.Thanks in advance and let me know if I can help you somehow. Hope it helps
The text was updated successfully, but these errors were encountered: