-
Notifications
You must be signed in to change notification settings - Fork 22
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
More informative errors #7
Comments
Ok so I just used lein-git-deps to use the updated ring-swagger from github (specifically, commit 0b854b6). Now when I run the app, there are no more exceptions. This was the schema that was causing problems: :return {:a s/Str
:b {s/Str {:c s/Str
:d s/Int}}} The /swagger.json endpoint is returning a JSON file, but now there's a new problem: From the main /index.html endpoint (swagger-ui), the following message is shown: fetching resource list: http://localhost:8080/swagger.json; Please wait. and it gets stuck there. This problem happened when I tried to remove the problematic schema (omitting the :return keyword) before adding the updated ring-swagger. After adding the new dependency, I added back the :return keyword for the problematic schema and the same behavior shows up again. Any ideas what's causing it to get stuck? There are no exceptions in the logs. |
Hi. Agree on better error messages. For this case: your schema has a |
the root cause should be fixed in |
Cool. Yeah that fixes it. But I still have the "stuck" problem. The JavaScript console gave the following error: Uncaught TypeError: Swagger 2.0 does not support null types ([object Object],). See https://github.com/swagger-api/swagger-spec/issues/229. I have checked all my schemas and I do not have any "null" types. UPDATE: After looking through my schemas for anything that can be "nullable" I found (s/conditional empty? s/Str :else sc/Email) That's probably bad API design from my end, but I take it that (s/conditional) is not supported either? Removing that conditional allowed me to see the API listing again. |
So, there is no swagger-bindings for But, Swagger has dropped support of the |
Currently, I use [kixi/schema-contrib "0.2.0"] for the sc/Email schema and the sc/URI which are sprinkled throughout the codebase inside of maps. What steps do I take to support these and add documentation for them so that they show up in the Swagger UI when I click on the endpoint? |
I'm currently getting an error when I access the root path of my compojure-api app:
Then when I visit http://localhost:8080/swagger.json, I get a more informative error message, but it's still pretty obscure.
So I understand the problem is with one of my schema specified in :return. I can debug this with trial-and-error going by adding/removing one schema at at time. But I was wondering if there was a way to get much more precise error messages like which route caused the failure, etc.
The text was updated successfully, but these errors were encountered: