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
The "definitions" section of this will be ignored, instead only the "definitions" from analysisBase.json will be included in the final rendered schema, resulting in an invalid schema.
Description
As mentioned above, the end result is an invalid schema. When this is used in production, an error occurs - see this trace. This trace was produced by trying to use this schema.
While sometimes the use of "definitions" can be avoided (e.g. in a later version of the schema mentioned above), this is often a useful features of JSON-Schema.
Expected Behaviour
The "definitions" section of schema should be merged with that of the analysisBase.json.
Actual Behaviour
As mentioned above, the contents of the "definitions" part of an uploaded schema is silently ignored.
Possible Fix
I think that the relevant code that merges schemas is in renderPayloadJsonSchema. This could be extended to merge "definitions" much as "properties" are currently merged.
Steps to Reproduce
Upload the schema mentioned above in the description
Try and upload a JSON document compliant with the schema
Your Environment
Version used: 5.2.0
Environment name and version (e.g. Chrome 39, node.js 5.4): Not relevant
Operating System and version (desktop or mobile): Upload was done using Muse
If an uploaded schema contains a "definitions" section, this will be ignored when the schema is uploaded to Song. E.g.
The
"definitions"
section of this will be ignored, instead only the"definitions"
fromanalysisBase.json
will be included in the final rendered schema, resulting in an invalid schema.Description
As mentioned above, the end result is an invalid schema. When this is used in production, an error occurs - see this trace. This trace was produced by trying to use this schema.
While sometimes the use of
"definitions"
can be avoided (e.g. in a later version of the schema mentioned above), this is often a useful features of JSON-Schema.Expected Behaviour
The
"definitions"
section of schema should be merged with that of theanalysisBase.json
.Actual Behaviour
As mentioned above, the contents of the
"definitions"
part of an uploaded schema is silently ignored.Possible Fix
I think that the relevant code that merges schemas is in
renderPayloadJsonSchema
. This could be extended to merge"definitions"
much as"properties"
are currently merged.Steps to Reproduce
Your Environment
The text was updated successfully, but these errors were encountered: