Skip to content

Suggest to remove singleton OpenAPI object and make Clients instanced. #703

Closed
@cmcnicholas

Description

@cmcnicholas

Currently the Client templates reference a single OpenAPI reference which is used to set the token or headers.

An example where this approach fails is trying to contact two API's with the same generated codegen, we frequently do this e.g. from staging to live environment stagingapi.product.com -> api.product.com and there isn't really a workaround other than set the token before every request.

This does lead on to the question as to why the client functions are templated as statics, I believe having to instance the clients and provide the configuration would work better with DI and testing frameworks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions