jsonnext / codemirror-json-schema

A JSONSchema enabled mode for codemirror 6, for json4 and json5, inspired by monaco-json
https://codemirror-json-schema.netlify.app
MIT License
56 stars 9 forks source link

Error validation #98

Closed rookie-luochao closed 1 month ago

rookie-luochao commented 1 month ago
image

expected object, the actual value is 123, but no verification error is prompted

imolorhe commented 1 month ago

@acao any reason you don't want to provide validation when there's no pointer?

https://github.com/acao/codemirror-json-schema/blob/main/src/json-validation.ts#L139-L140

In this case we wouldn't have a matching pointer so we don't show the error (Note: we can append the root # pointer but the effect will be the same as just using pushRoot())

rookie-luochao commented 1 month ago

I think this behavior is a bug, monaco-editor will prompt this behavior, because I tend to replace monaco-editor because it is too big to implement json-editor