Skip to content

x-www-form-urlencoded in requestBody: no parameters generated #656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
supermihi opened this issue Aug 19, 2022 · 1 comment · Fixed by #662
Closed

x-www-form-urlencoded in requestBody: no parameters generated #656

supermihi opened this issue Aug 19, 2022 · 1 comment · Fixed by #662
Milestone

Comments

@supermihi
Copy link
Contributor

I am trying to generate a client for the following spec:

openapi: 3.0.3
info:
  title: Test
  version: 1.2.3
paths:
  /bar:
    post:
      summary: Do something
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [ form_param ]
              properties:
                form_param:
                  type: string
      responses:
        200:
          description: ""

The output however doesn't contain any parameters:

def sync_detailed(
    *,
    client: Client,
) -> Response[Any]:
    """Do something

    Returns:
        Response[Any]
    """
    ...

I am using the latest version:

❯ openapi-python-client --version
openapi-python-client version: 0.11.5

Any hints? Is this a missing feature? From the closed issues, I got the impression that form data should be supported, in general?

The parameter is rendered correctly in Swagger UI / editor, so I am pretty sure that the spec is correct.

@supermihi
Copy link
Contributor Author

While debugging the problem, I noticed that the current implementation supports form bodies only if the schema is provided as reference. I'm preparing a PR to fix this.

dbanty added a commit that referenced this issue Aug 27, 2022
…hanks @supermihi!

Co-authored-by: Dylan Anthony <[email protected]>
Co-authored-by: Michael Helmling <[email protected]>
@dbanty dbanty added this to the 0.11.6 milestone Aug 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants