GithubHelp home page GithubHelp logo

Comments (11)

Wicpar avatar Wicpar commented on May 20, 2024 1

Ah i see, i'll look into it.

from ktor-openapi-generator.

y9san9 avatar y9san9 commented on May 20, 2024

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

from ktor-openapi-generator.

Wicpar avatar Wicpar commented on May 20, 2024

can you try the new syntax ?
https://github.com/papsign/Ktor-OpenAPI-Generator/wiki/A-few-examples#exceptions-and-multiple-responses

from ktor-openapi-generator.

Wicpar avatar Wicpar commented on May 20, 2024

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.

from ktor-openapi-generator.

Wicpar avatar Wicpar commented on May 20, 2024

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

from ktor-openapi-generator.

y9san9 avatar y9san9 commented on May 20, 2024

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

from ktor-openapi-generator.

Wicpar avatar Wicpar commented on May 20, 2024

can you provide a code sample ?

from ktor-openapi-generator.

y9san9 avatar y9san9 commented on May 20, 2024

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

from ktor-openapi-generator.

y9san9 avatar y9san9 commented on May 20, 2024

That's it
image

from ktor-openapi-generator.

y9san9 avatar y9san9 commented on May 20, 2024

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

from ktor-openapi-generator.

Wicpar avatar Wicpar commented on May 20, 2024

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

from ktor-openapi-generator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.