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
Make sure to fork this template and run yarn generate in the terminal.
Please make sure Mesh package versions under package.json matches yours.
2. A failing test has been provided
3. A local solution has been provided
4. A pull request is pending review
Describe the bug
The OmniGraph-OpenAPI library cannot deep merge objects listed in an allOf operator.
For a component combining properties of different objects via the allOf keyword, if any property of these objects exists in more than one of them and this property is also an object, then these object-like overlapping properties will not be merged into one single object, combining all their different sub-properties. Instead, only the sub-properties of the last object-like overlapping property will be included in the resulting object.
A more detailed example of the issue has been added here.
When processing this schema, it should be expected that the Person.data.attributes sub-property resulted in the combination of all the attributes object-properties corresponding to the objects listed in the allOf operator:
Issue workflow progress
Progress of the issue based on the
Contributor Workflow
Github,
Stackblitz
or
CodeSandbox
Describe the bug
The OmniGraph-OpenAPI library cannot deep merge objects listed in an
allOf
operator.For a component combining properties of different objects via the
allOf
keyword, if any property of these objects exists in more than one of them and this property is also an object, then these object-like overlapping properties will not be merged into one single object, combining all their different sub-properties. Instead, only the sub-properties of the last object-like overlapping property will be included in the resulting object.A more detailed example of the issue has been added here.
To Reproduce Steps to reproduce the behavior:
loadGraphQLSchemaFromOpenAPI
function from the@omnigraph/openapi
library, load a schema containing objects listed in anallOf
operator with overlapping properties (e.g.: https://github.com/cweckesser/graphql-mesh-testing/blob/main/packages/loaders/openapi/graphql/schemas/test-schema.json, here theattributes
property is defined in two objects).allOf
operator will be in the resulting schemaFor an already-working example that reproduces this issue, consider the following code sandbox
Alternatively, the following repository can be checked out and then the following instructions can be followed:
cd packages/loaders/openapi
yarn
yarn test:unit
yarn start
Expected behavior
The overlapping properties of objects listed in an
allOf
operator should be deep merged. Consider the following example:When processing this schema, it should be expected that the
Person.data.attributes
sub-property resulted in the combination of all theattributes
object-properties corresponding to the objects listed in theallOf
operator:Environment:
Additional context
The text was updated successfully, but these errors were encountered: