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
#204 describes an issue with anyOf (and oneOf) error messaging. However, one way to solve this is to provide a schema-specific error message using the custom JSON property errorMessage as illustrated in this example.
However, the use of the required property (or the dependencies property) on anyOf subschemas will prevent monaco from surfacing it as a valid suggestion. In my example above, p1.shape can be fulfilled by both rectangle and square. However, the only autocomplete option that gets offered is rectangle
The reason this occurs is because the square subschema defines a required field side that is only available within that schema. It essentially ends up making square a hidden option for p1.shape critically breaking the expected completion.
PS: If side were to be removed from the required array in L62 of the example, completions start working as expected.
The text was updated successfully, but these errors were encountered:
The problem highlighted in this github issue is that code completion does not work as expected and only offers one among many choices that may be available for the property defined using the oneOf/anyOf construct. I wonder if the issue is more with vscode-json-languageservice treatment of oneOf/anyOf rather than it being with monaco itself.
#204 describes an issue with
anyOf
(andoneOf
) error messaging. However, one way to solve this is to provide a schema-specific error message using the custom JSON propertyerrorMessage
as illustrated in this example.However, the use of the
required
property (or thedependencies
property) onanyOf
subschemas will prevent monaco from surfacing it as a valid suggestion. In my example above,p1.shape
can be fulfilled by bothrectangle
andsquare
. However, the only autocomplete option that gets offered isrectangle
The reason this occurs is because the square subschema defines a
required
fieldside
that is only available within that schema. It essentially ends up makingsquare
a hidden option forp1.shape
critically breaking the expected completion.PS: If
side
were to be removed from therequired
array in L62 of the example, completions start working as expected.The text was updated successfully, but these errors were encountered: