Coder Social home page Coder Social logo

Comments (8)

bikash-singh01 avatar bikash-singh01 commented on August 15, 2024 1

Hey @mariohmol, its working fine. Issue on my part.
For anyone who stumble across, what i learned from my mistakes

  1. Check the version of the jsoneditor and ang-jsoneditor
  2. additionalProperties is important part of jsonSchema
  3. verify if you are setting schema correctly in the options

Edit
@mariohmol Thank you for the wrapper, it made my life lot easier

from ang-jsoneditor.

mariohmol avatar mariohmol commented on August 15, 2024 1

thanks for sharing @bikash-singh01

from ang-jsoneditor.

mariohmol avatar mariohmol commented on August 15, 2024

Hi... can u provide a working example using jsoneditor?

i checked here on the ang-jsoneditor and we have the setSchema mapped.. and we are passing this to the real editor..

so maybe is how you have the this.mySchemaAsJson

or try to provide an example of this using this as starting point https://stackblitz.com/edit/ang-jsoneditor

from ang-jsoneditor.

tar565 avatar tar565 commented on August 15, 2024

Hi there, I got this working, following the example attached. Was initialising the editOptions in ngOnInit() originally and then setting the this.editorOptions.schema after a button click, which is only enabled after some other validation conditions are met. The schema was not getting set correctly at that point but on setting it in the ngOnInit(), along with the this.data, all worked fine.

from ang-jsoneditor.

mariohmol avatar mariohmol commented on August 15, 2024

awesome!! thanks for answering

from ang-jsoneditor.

bikash-singh01 avatar bikash-singh01 commented on August 15, 2024

https://stackblitz.com/edit/ang-jsoneditor

Do this example work? I changed one parameter lets say "id" to "i" but I get no error.

from ang-jsoneditor.

mariohmol avatar mariohmol commented on August 15, 2024

Wel, I think it works, what u are trying to do that its not working? share in stackblitz

from ang-jsoneditor.

bikash-singh01 avatar bikash-singh01 commented on August 15, 2024

I am looking for a way to provide schema to the jsoneditor using which the json text in the editor will be verified.
for example if my schema is

{
  "type": "object",
  "properties": {
      "name": {
          "type": "string"
       }
   }
}

Then if I put a JSON as

{
  "nam" :  "Bikash"
}

It should give an error saying
"Hey nam is not valid key" or somthing like that

from ang-jsoneditor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.