Skip to content

Query parameters containing . generate invalid code #30

@micolous

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions