Skip to content

Query parameters containing . generate invalid code #30

Description

@micolous

Example of a parameter with . which breaks the generator (as YAML-formatted OAS):

/example:
  get:
    parameters:
      - in: query
        name: foo.bar
        schema:
          format: int32
          type: integer
      - in: query
        name: foo.baz
        schema:
          format: int32
          type: integer

The generator builds the API method as:

async def example(
  self,
  foo.bar: int,
  foo.baz: int,
  **kwargs: Any
) -> ExampleResponse:
  _query_params = {
    "foo.bar": foo.bar,
    "foo.baz": foo.baz,
  }
  # ...

OpenAPI Generator replaces . with _, so the field name becomes foo_bar.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions