Giter Club home page Giter Club logo

Comments (8)

yonaskolb avatar yonaskolb commented on July 17, 2024

Generating header parameters is unfortunately not supported yet. This issue tracks that addition #9

In terms of them not being required, that is controlled in the swagger spec. In your spec they are all marked as required

from swaggen.

mihirpmehta avatar mihirpmehta commented on July 17, 2024

In that case it should not be mandatory to build SignUp Model... Parameter that needs to be added in request should be optional for model or request

from swaggen.

yonaskolb avatar yonaskolb commented on July 17, 2024

I wasn't aware that POST bodies could be optional. Is your SignupRequestModel really optional? Wouldn't the request fail without it?

from swaggen.

mihirpmehta avatar mihirpmehta commented on July 17, 2024

No But to build the SignupRequestModel "option" parameter should not be mandatory ... i.e. SignupRequestModel class can have constructor where option argument can be passed as nil.

Thanks

from swaggen.

yonaskolb avatar yonaskolb commented on July 17, 2024

Ahh I understand. You can use the convenience init for passing in specific Option values. As they are all optional you don't need to specify them.

AuthSignupPost.Request(body: signupRequestModel)

from swaggen.

yonaskolb avatar yonaskolb commented on July 17, 2024

Let me know if that doesn't work or you have any other issues. Closing for now

from swaggen.

mihirpmehta avatar mihirpmehta commented on July 17, 2024

I am using your tool to generate my API only one thing is not clear to me is how to authorise some request

My server uses Bearer Token for authorise user... how should i use authorise protocol ?

Right now i am just putting it in header Authorisation like

APIClient.default.defaultHeaders["Authorization"] = "Bearer \(bearerToken)

But not sure if this is the right way and if it is than what is the use of
public var authorizer: RequestAuthorizer?

from swaggen.

yonaskolb avatar yonaskolb commented on July 17, 2024

@mihirpmehta how you're doing it is fine. The RequestAuthorizer is only if you need to authorize asynchronously or only for certain requests.

Mind you RequestAuthorizer is being replaced with RequestBehaviour.validate in #103

from swaggen.

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.