Closed y9san9 closed 4 years ago
I have tried same with KotlinNullPointerException but not with my custom one. The result is same, logs here
can you try the new syntax ? https://github.com/papsign/Ktor-OpenAPI-Generator/wiki/A-few-examples#exceptions-and-multiple-responses
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.
Another issue could be that your gradle cache has an older version of snapshot, try to upgrade to a release version
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
can you provide a code sample ?
Sure, I've replaced custom errors with null pointer
throws( apiException<KotlinNullPointerException, String>(HttpStatusCode.BadRequest, "test"), apiException<KotlinNullPointerException, String>(HttpStatusCode.BadRequest, "test"), fn = fn )
That's it
You should use another json code (and also I think that required ability to change example names)
Ah i see, i'll look into it.
fixed in 0.2-beta.4 For more accurate names and descriptions there is no quick fix, this whole part needs a rework... #48
throws(APIException.apiException<ApiError, String>(HttpStatusCode.BadRequest, ""), fn = fn)
This code have that result for me