fix: passes missing host document references to all layers#2033
Conversation
|
I'm not sure we have to pass the host document through every layer as I think we can store it in the ParsingContext object which is accessible via the node object. I also think we may need to store the "Entry Document" also, when dealing with multi-document descriptions. Security Schemes and Tags are only supposed to be resolved from the "Entry Document" and not the Host document. |
|
@darrelmiller if you look at a high level at this PR changes you'll noticed that all of them are for deserialization scenarios. Before this PR: deserialize a document, try to access the object model, references are not getting resolved. This is a really broken experience. I think part of the reason why references were not being set properly is because of the optional parameters: the compiler was not yelling at the developer something is missing. I expect the vast majority of package consumers will never use those methods. But for those who do, I think it's a better experience to tell them "hey, make sure you provide what we need to give you a valid document later" rather than telling them "do whatever you want" and blow up in their faces later on. Another aspect that comforts me in this position is that references in their current form are extremely hard to debug by a consumer unless you link the sources. Which we can't expect anymore but us and a few advanced developers to do. If you think those changes break things for external documents (or other scenarios), please provide test cases/examples I can incorporate with this pull request. |
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
|


reviewers, please review #2032 first.