Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON validation against provided schema? #550

Open
daudnadeem opened this issue Nov 2, 2023 · 2 comments
Open

JSON validation against provided schema? #550

daudnadeem opened this issue Nov 2, 2023 · 2 comments
Labels

Comments

@daudnadeem
Copy link

Is your feature request related to a problem? Please describe.
I am trying to use your (super-cool) editor to edit some JSON on a website. When I submit the JSON, it is validated against a schema in the backend and then it's either allowed (200) or denied (422). When it's denied, I would like to parse the error and show it in the editor.

e.g.

{
  name: "Adam"
  age: "24"
}

And if age: int

I would like "24" to be highlighted, and the error from the backend parse "needs to be an int" straight from the backend.

Additional context
I feel there may already be a way to do this, I am a full stack dev trying to break into the FE world. Have good experience with the backend, if there is a way to already do this please guide me. I am trying to use onValidate and I see it gets markers from the errors. So all I really need to do is insert custom markers?

@Viicos
Copy link

Viicos commented Mar 4, 2024

This repo is a React wrapper for the actual Monaco editor from Microsoft: https://github.com/microsoft/monaco-editor/, so you will probably find more info there. In particular, you can check this example.

Copy link

This issue has been marked as stale due to inactivity. It will be closed in 7 days unless further activity occurs.

@github-actions github-actions bot added the Stale label Mar 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants