-
-
Notifications
You must be signed in to change notification settings - Fork 227
Support non-schema components and references (e.g. parameters) #288
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
Comments
I believe the only shared components supported right now are actually schemas (the only ones I've ever used 😅). Now that I have a real world example of someone using other components, I guess it's time to plan support! |
I'm willing to help implement this. Can you give a brief overview of how to do it? |
It might be fairly complex, but you're welcome to give it a shot! Parameters specifically are added in References to schemas are tracked in
Hopefully that's enough to get you started if you want to give this a shot, like I said though I think this one will be pretty complex since parameters don't even really exist as a concept in the source right now except within an |
Then I think it'll require more time than I'm likely to have available. |
I understand completely 😁 |
Here is an example json I have crafted from a more complex API which wasn't working as expected
In order to get this implemented quickly, wouldn't it make sense to just preprocess the json and replace every "$ref" by their equivalent? |
Is this slated for development? I am somewhat new to openapi, but I am happy to try and help out if feasible. |
I don't believe anyone is working on this currently, so feel free to give it a shot. I don't have much time to implement stuff myself right now but I am still reviewing/merging stuff periodically 😅. |
@dbanty I'll kick the tires, no guarantees. Anything I should consider other than what's written in: |
Only what I commented above about roughly where the implementation should probably go. We preprocess components first, just need to also process and store the non-schema components. Then those can be referenced later when processing the schemas and building params. |
Here's YAML and an output log. |
The scope of this issue was bigger than just |
…. Thanks @jsanchez7SC! Closes #288. Co-authored-by: Jordi Sanchez <[email protected]>
Describe the bug
When building the client with the path parameter in the yaml file which are passed through reference, it does not consider the parameter and the generated client does not have those referenced parameters.
To Reproduce
Steps to reproduce the behavior:
parameters:
- $ref: '#/components/parameters/sampleparam'
Expected behavior
It should consider the path parameters passed through reference too same as the parameters that it considers when passed with the standard way.
OpenAPI Spec File
Any openapi spec file could be used.
Desktop (please complete the following information):
Additional context
It does not raise any error while building the client, but it does not have the referenced parameters in the generated client.
The text was updated successfully, but these errors were encountered: