Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

[REQ] name endpoint fns/methods using spec case operationId #32

@spacether

Description

@spacether

Is your feature request related to a problem? Please describe.

Some engineers prefer that endpoint methods/fns be named using the original operationId spec case
Can this feature be added to python-experimental?
@rm3l

Describe the solution you'd like

Using the original case is possible but awkward because operationIds can be any string, even invalid python variable names like:

  • " "
  • "123"
  • "A-B"

So to implement this, the api classes would:

  • be an instance of TypedDict going from operationId to endpoint fn OR
  • assign the operationId in the class __dict__

Whichever one best works with type hints would be chosen.
To do this, api_client may have to be passed in to each endpoint call.
Pseudocode would look like:

operation_id = "A-B"
endpoint = FakeApi[operation_id]
api_response = endpoint(query=params={}, body={})

Describe alternatives you've considered

Or we can keep the code as-is where operationId is converted to python snake case

Additional context

This was requested in: OpenAPITools/openapi-generator#5214 (comment)
Similar issue: OpenAPITools/openapi-generator#3813

Please vote for what you want!

  • If you want spec case used for operationId please upvote with thumbs up 👍
  • if want the code to keep using snake case for endpoint method names vote thumbs down 👎

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions