You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry - this is way too big for a single commit.
This changes the approach for handling references to be one where data
can be merged between a chain of references. Previously the approach was
to only allow a single $ref field (as per OpenAPI 3.0)
The reason for making this change is based on aspects in the
specification notably the reference object [1] that allows title and
summary fields to be overridden through the referencing process.
As far as I could tell schemas also share this property as per the newer
JSON Schema specifications (most applicable one for OpenAPI 3.1 is
2020-12) though I found it quite hard to find a clear source on
behaviour [2].
To support this there are now some new concepts:
- A node context now has multiple source_locations - as data can be
combined from multiple places
- A node context has a concept, input_locations, which record all of the
data involved in a node that aren't purely references (i.e. all the
source locations that contributed to the node data)
- There is now a Referenceable module that can be mixed into NodeFactory
classes, this allows NodeFactories to act more as the mediator in
charge of a reference, whereas previously more went through a
Reference field (this is to reflect the nature of merging)
- Aspects of the ObjectFactory::NodeBuilder class have been separated
into ObjectFactory::NodeErrors, ObjectFactory::ResolvedInputBuilder
and a new iteration of it's namesake. This is to reflect an increase
in complexity in node building due to the node data merging
- As part of the new NodeBuilder class the building of node objects is
now done by the NodeBuilder class calling public methods on node
factories. This has led to them having their #build_object methods
replaced with #build_node methods that need a public interface
[1]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject
[2]: https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.3.1
0 commit comments