Skip to content

$ref in path parameters doesn't seem to work #605

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

Open
jrobbins-LiveData opened this issue Apr 30, 2022 · 0 comments
Open

$ref in path parameters doesn't seem to work #605

jrobbins-LiveData opened this issue Apr 30, 2022 · 0 comments
Labels
🐞bug Something isn't working

Comments

@jrobbins-LiveData
Copy link

Describe the bug
If a get path has a parameter using $ref to point to #/components/parameters, the generated API lacks the corresponding kwarg. If one "hoists" the indirect parameter up into the path's parameters, it works as expected.

To Reproduce
See this repo for a reproducible example.
And see this repo for the same schema without the $ref, working as expected.

Expected behavior
I expect to see the optional page kwarg in both generated APIs.

I see this in the $ref example:

def sync(
    *,
    client: Client,
) -> Optional[List[str]]:

and this in the noref example:

def sync(
    *,
    client: Client,
    page: Union[Unset, None, GetTestPage] = UNSET,
) -> Optional[List[str]]:

OpenAPI Spec File
A link to your openapi.json which produces this issue.

Desktop (please complete the following information):

  • OS: Microsoft Windows 10 Pro 10.0.19044 Build 19044
  • Python Version: 3.9.12
  • openapi-python-client version 0.11.1
@jrobbins-LiveData jrobbins-LiveData added the 🐞bug Something isn't working label Apr 30, 2022
github-merge-queue bot pushed a commit that referenced this issue Jun 15, 2024
Fixes #595 

Perhaps similar solution can be applied to #605 

## Description
The requestBody with $ref was not handled. `requestBodies` in components
should be injected into `_add_body` function.

---------

Co-authored-by: Dylan Anthony <dbanty@users.noreply.github.com>
micha91 pushed a commit to micha91/openapi-python-client that referenced this issue May 13, 2025
Fixes openapi-generators#595

Perhaps similar solution can be applied to openapi-generators#605

## Description
The requestBody with $ref was not handled. `requestBodies` in components
should be injected into `_add_body` function.

---------

Co-authored-by: Dylan Anthony <dbanty@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant