We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
PathItem
Operation
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
Describe the bug I received warning when trying to generate client for example OpenAPI (see below).
ERROR parsing POST /foo/{bar} within default. Endpoint will not be generated. Could not reconcile duplicate parameters named bar
OAS says A unique parameter is defined by a combination of a name and location. See question in specification repo.
A unique parameter is defined by a combination of a name and location.
it's OK to have parameters with the same name as long as they have different location (i.e. path vs header).
To Reproduce Steps to reproduce the behavior:
post_foo_bar.py
Expected behavior Expected two different parameters in generated client. Parameter bar in POST method must be overridden.
bar
# Generated `post_foo_bar.py` ... def _get_kwargs( *, client: Client, bar_path: str = "OVERRIDDEN_WITH_DEFAULT_VALUE", # from `Operation` json_body: str, bar_header: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: url = "{}/foo/{bar}".format(client.base_url, bar=bar_path) headers: Dict[str, Any] = client.get_headers() cookies: Dict[str, Any] = client.get_cookies() if bar_header is not UNSET: headers["bar"] = bar_header ...
# Generated delete_foo_bar.py ... def _get_kwargs( *, client: Client, bar_path: str, # from `PathItem` ) -> Dict[str, Any]: ...
OpenAPI Spec File
openapi: 3.0.3 info: title: Parameters example version: 1.0.0 servers: - url: 'https://example.com/api/rest' paths: '/foo/{bar}': post: parameters: - name: bar required: true in: path schema: type: string default: OVERRIDDEN_WITH_DEFAULT_VALUE - name: bar in: header schema: type: string requestBody: content: application/json: schema: type: string responses: '200': description: Example content: application/json: schema: type: string delete: responses: '200': description: OK parameters: - required: true name: bar in: path schema: type: string
Desktop (please complete the following information):
Additional context I wrote a fix for this issue. I want to test it and make PR soon. @dbanty what do you think about it?
The text was updated successfully, but these errors were encountered:
fix: Parameters from PathItem can now be overriden in Operation [#…
53cdd94
…458 & #457]. Thanks @mtovts!
Will be included in 0.10.2
Sorry, something went wrong.
No branches or pull requests
Describe the bug
I received warning when trying to generate client for example OpenAPI (see below).
OAS says
A unique parameter is defined by a combination of a name and location.
See question in specification repo.To Reproduce
Steps to reproduce the behavior:
post_foo_bar.py
module not generated.Expected behavior
Expected two different parameters in generated client. Parameter
bar
in POST method must be overridden.OpenAPI Spec File
Desktop (please complete the following information):
Additional context
I wrote a fix for this issue. I want to test it and make PR soon. @dbanty what do you think about it?
The text was updated successfully, but these errors were encountered: