-
-
Notifications
You must be signed in to change notification settings - Fork 539
[incomplete] Allow external references #433
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
…degen into ref-file
pointers to nodes inside a schema object
…degen into ref-file
This pull request introduces 2 alerts when merging deff23e into bb78808 - view on LGTM.com new alerts:
|
Codecov Report
@@ Coverage Diff @@
## master #433 +/- ##
==========================================
- Coverage 93.49% 90.12% -3.38%
==========================================
Files 106 106
Lines 1261 1337 +76
Branches 219 236 +17
==========================================
+ Hits 1179 1205 +26
- Misses 82 132 +50
Continue to review full report at Codecov.
|
@chris-armstrong Interesting Chris! I'm working on some core rewrites, the resolving / bundeling logic is indeed nice to add. |
Great! I'll continue working on it to clean it up and get it tested properly and add it back to the |
@ferdikoomen this is something I need. You had mentioned some core rewrites. Would you say that is blocking this PR from moving forward? |
Instead of continuing development of this one, which was becoming extensive, I've found a library that achieves the same effect and can be integrated with minimal code change, so I've opened #573 instead to achieve the same outcome. |
I'm opening this PR to solicit feedback
At the moment, openapi-typescript-codegen can only resolve
$ref
references to components in the same file. I've begun working on support for resolving external$ref
references (i.e. where the openapi file has '$ref' entries that refer to other files relative to it on the filesystem).This makes it easier to split a large openapi.yml into multiple files. It also helps to bring the tool closer in line with the JSON Reference spec, which is allowed by the OpenAPI 3.0 specification.
I've deliberately neglected URL references other than those on the current filesystem for now, but there's no reason this couldn't be added (perhaps behind a flag for those who don't want it making HTTP calls?)
This PR isn't complete, as in not all cases where
$ref
is allowed have been updated and tested, and it has only been done for the 3.0 side.Could I get some feedback as to whether this PR would be accepted if continued along its current lines, or if it will require some more significant changes to the way it is structured? I'd love to be able to get this functionality into the main codebase.