Skip to content
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 'throws' rendering #45

Closed
y9san9 opened this issue May 14, 2020 · 11 comments
Closed

incorrect 'throws' rendering #45

y9san9 opened this issue May 14, 2020 · 11 comments

Comments

@y9san9
Copy link

y9san9 commented May 14, 2020

throws(APIException.apiException<ApiError, String>(HttpStatusCode.BadRequest, ""), fn = fn)
This code have that result for me
image

@y9san9
Copy link
Author

y9san9 commented May 14, 2020

I have tried same with KotlinNullPointerException but not with my custom one. The result is same, logs here
image

@Wicpar
Copy link
Collaborator

Wicpar commented May 14, 2020

@Wicpar
Copy link
Collaborator

Wicpar commented May 14, 2020

Also, swagger-ui does not cover the full OpenAPI spec, i need to see the openapi.json for that request to verify what is going wrong.

@Wicpar
Copy link
Collaborator

Wicpar commented May 14, 2020

Another issue could be that your gradle cache has an older version of snapshot, try to upgrade to a release version

@y9san9
Copy link
Author

y9san9 commented May 14, 2020

I have found the reason. There was another throws {} block in upper level. If sumplify
throws(...){ throws(...){} }
I expected to catch exceptions by upper block for all requests, then jsonify and respond with it, but show error specifications for api in lover block for every single request
UPD: Just now have same error by using vararg APIException

@Wicpar
Copy link
Collaborator

Wicpar commented May 14, 2020

can you provide a code sample ?

@y9san9
Copy link
Author

y9san9 commented May 14, 2020

Sure, I've replaced custom errors with null pointer
throws( apiException<KotlinNullPointerException, String>(HttpStatusCode.BadRequest, "test"), apiException<KotlinNullPointerException, String>(HttpStatusCode.BadRequest, "test"), fn = fn )

@y9san9 y9san9 changed the title Swagger cannot render throws incorrect 'throws' rendering May 14, 2020
@y9san9
Copy link
Author

y9san9 commented May 14, 2020

That's it
image

@y9san9
Copy link
Author

y9san9 commented May 14, 2020

You should use another json code (and also I think that required ability to change example names)
image

@Wicpar
Copy link
Collaborator

Wicpar commented May 15, 2020

Ah i see, i'll look into it.

@Wicpar
Copy link
Collaborator

Wicpar commented May 15, 2020

fixed in 0.2-beta.4
For more accurate names and descriptions there is no quick fix, this whole part needs a rework... #48

@Wicpar Wicpar closed this as completed May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants