-
-
Notifications
You must be signed in to change notification settings - Fork 80
Add support for different bundling modes - compose bundle mode #401
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
Conversation
eebb49d
to
881d599
Compare
@daveshanley I realized while testing that some of the nodes don't carry over the Example here is:
becomes this after bundling:
I think this is cause I'm building the nodes in the low level and converting to high level, and either I'm not carrying over the proper fields or I'm missing a step somewhere. For example, this is how I build the nodes and add them to the high level:
Is there an example in the codebase I should be following? How do I properly build these nodes? |
extremely interested in this PR, as it would finally solve recursive references being ignored when bundling. Bundling is my only complaint with libopenapi, as it's very simple. Ideal scenario, we have the same option as redocly, and have a dereference option that can be true or false. If true, we inline everything, but recursive refs go in components/schemas in the root doc. otherwise, everything just goes under components/schemas. If you need any help in bringing this to 100%. I'd love to help out so it can get merged |
I have to admit, this looks right to me. But then again, it's been a good long while since I looked at this part of the codebase. The best place to look for examples on how to build high level objects from scratch is here: https://github.com/pb33f/libopenapi/tree/main/datamodel/high/v3 Look at the tests. |
@daveshanley thanks, digging in it might be that not all the nodes get created when doing this method, seems like another thing I can tackle as a separate task. but I'll confirm before I push. appreciate you taking a look <3 @califlower yeah, feel free to give this a pull and a test. I think I might be done with this soon. Would love more tests and verification but I'll reach out if I'm stuck again! |
881d599
to
69d9763
Compare
@califlower I've pretty much burnt my engines out and still need to fix the merging and stuff. Do you mind checking the tests in I'm failing it with:
|
This feature is not an easy one to build. It's why I have not dug in yet - I need a clear few days to really open up the brain on it. |
@daveshanley no problem. I actually have it working pretty well using BuildModel, Build, New*. Let me know if you rather have me to throw this back to draft. |
I'll try and take a look at this this weekend |
This feature was implemented in |
amazing!! |
@daveshanley oh wow, at least I learned something! Pretty new at Go as well so great to see how you tackled it. Thanks! |
This PR improves the OpenAPI bundler to correctly handle complex reference scenarios by resolving references without placing them inline and instead referencing them in the components and schema. The bundler now successfully creates a complete bundled document from specifications with nested and cross-component references.
Changes
Technical Details
Testing
Verified the bundler can now successfully bundle specifications with complex reference dependencies, including the test case with AccountResponse referencing Account.
Added a bundledRef test to test more advanced exploded specs
Next Steps