JSON Schema explained and validated in IntelliJ

Поділитися
Вставка
  • Опубліковано 5 лис 2024

КОМЕНТАРІ • 58

  • @chanatillo
    @chanatillo 3 роки тому +8

    years later and this tutorial is STILL amazing, thanks!

  • @velhobugado0230
    @velhobugado0230 2 роки тому +2

    very well explanatory video, even without understanding almost anything in English, I managed to do it on the first attempt

    • @MikesTechCorner
      @MikesTechCorner  2 роки тому +1

      I am happy to hear that.

    • @velhobugado0230
      @velhobugado0230 2 роки тому

      @@MikesTechCorner I started a project and it already has more than 3k in lines xd

  • @ThecrackpotdadPlus
    @ThecrackpotdadPlus 3 роки тому +2

    Thank you, this has been really helpful. Brilliant.

  • @DenisKisina
    @DenisKisina Рік тому +1

    Thanks for your video, it's very helpful.

    • @MikesTechCorner
      @MikesTechCorner  Рік тому +1

      You are welcome! Thx for commenting. :)

    • @DenisKisina
      @DenisKisina Рік тому +1

      @@MikesTechCorner Just one question though, how would you detail with fields that are not in jsonschema or misspelled but not required?

    • @MikesTechCorner
      @MikesTechCorner  Рік тому +1

      @@DenisKisina I would see it as an error and the json parser so per default too. You can configure it to ignore unknown fields. With jackson it is an annotation on top of the class. But I think the right thing to do was to reject the json at communicate with the call about why they add the extra fields?. You are specifying your api and should accept garbage data.

    • @DenisKisina
      @DenisKisina Рік тому +1

      @@MikesTechCorner I agree with your suggestion of handling and communicating the culprit fields.

  • @runningfly21
    @runningfly21 3 роки тому +2

    great tutorial! this was very helpful

  • @tranquiloteov
    @tranquiloteov 3 роки тому +2

    awsome tutorial. helped me a lot.

  • @movimovimania5521
    @movimovimania5521 2 роки тому +1

    Like you can create XML API samples from XML Schema can we create JSON API requests from JSON Schema?

    • @MikesTechCorner
      @MikesTechCorner  2 роки тому

      I think it is possible... I don't remember though... I think I would create the data with a Spring Boot unittest that generates the json... Maybe with Faker.

    • @movimovimania5521
      @movimovimania5521 2 роки тому

      @@MikesTechCorner Thanks Mike, would love to see a sample or some resources that cover this topic if you know / come across ..🙏

  • @velhobugado0230
    @velhobugado0230 2 роки тому +1

    the procedure is the same in pycharm which made it much easier

  • @udaypratapsingh8419
    @udaypratapsingh8419 4 роки тому +1

    So nicely explained

  • @jongtorralba1599
    @jongtorralba1599 3 роки тому +1

    lifesaver!,.. :) Thank you.

  • @sps014
    @sps014 3 роки тому +1

    Thank you so much , great explanation

  • @The_Leading_Three
    @The_Leading_Three 4 роки тому +2

    Thank you Mike.

  • @kimberlyserrano894
    @kimberlyserrano894 2 роки тому +1

    Hi mike, can you check why im being presented an error ( .detected is a required property, . Repeat_incident is a required property) for this required properties. It is working as intended though
    "required": [
    "detected",
    "repeat_incident"
    ],
    "dependencies": {
    "detected": {
    "oneOf": [
    {
    "properties": {
    "detected": {
    "type": "string",
    "enum": [
    "other"
    ]
    }
    },
    "required": [
    "detected_explanation"
    ]
    },

    • @MikesTechCorner
      @MikesTechCorner  2 роки тому

      "detected" is mentioned in the beginning as required. But try to change the schema and check the result.

  • @josevelez7994
    @josevelez7994 4 роки тому +1

    Very nice video. Thanks!

  • @gauravdalal9280
    @gauravdalal9280 3 роки тому +1

    hi Mike,
    Thanks for the great article.
    i need to validate a json against 'json schema" using java code. would you be able to share something helpful?
    thanks a ton in advance.

    • @MikesTechCorner
      @MikesTechCorner  3 роки тому +1

      Try this article: www.baeldung.com/introduction-to-json-schema-in-java

    • @gauravdalal9280
      @gauravdalal9280 3 роки тому +1

      @@MikesTechCorner Thanks for the suggestion. I followed this and this is working fine.
      Also in the example it says
      Schema schema = SchemaLoader.load(jsonSchema);
      schema.validate(jsonSubject);
      So if the schema validation fails it will give exception/error but in case of success it is not returning anything so "Is there a way to tell if the schema validation is successfully done"?
      I don't want to use
      System.out.println("Schema validation successfully done");
      🙂🙂

  • @MonicaJeswanth
    @MonicaJeswanth 4 роки тому +1

    Can we add dependencies for the checkboxes ?

    • @MikesTechCorner
      @MikesTechCorner  4 роки тому

      Hmmm I don't understand? The JSON Schema is just a file

  • @srenh-p3798
    @srenh-p3798 Рік тому

    God video, Mike!

  • @voiceguy554
    @voiceguy554 2 роки тому

    very well explained...thanks!

  • @agrajdahat7087
    @agrajdahat7087 4 роки тому +1

    Hi, can you please explain how to implement Json Schema validation for multi module projects. I am currently using spring boot and Swagger.

    • @MikesTechCorner
      @MikesTechCorner  4 роки тому +1

      Thats a great idea! Yes I have added it to my to do list

    • @agrajdahat7087
      @agrajdahat7087 4 роки тому +1

      @@MikesTechCorner Thank you so much

  • @hossamshehata-wp5gp
    @hossamshehata-wp5gp Рік тому +1

    can i add http method in the schema ?

    • @MikesTechCorner
      @MikesTechCorner  Рік тому

      No because it is a description of the data format... not a specification of protocol

  • @alexkhonko4115
    @alexkhonko4115 Рік тому +1

    awesome. Thank you

    • @MikesTechCorner
      @MikesTechCorner  Рік тому +1

      You are welcome. Try my website for data conversion

  • @kumarharshit4365
    @kumarharshit4365 3 роки тому +1

    Hi Mike
    Thanks for the video
    Can you please let us know how to validate a date using json schemas. For ex: if I want my date to be greater/lesser than a particular date.
    I am using ajv and there formatMinimum/formatMaximum are available but they seem to validate everything

    • @MikesTechCorner
      @MikesTechCorner  3 роки тому

      I don't think you can do that. You have to check that in your program.

  • @sproutboot
    @sproutboot 2 роки тому +1

    Bear cute

  • @mysocial
    @mysocial 3 роки тому +1

    Jumped to 13:00

  • @lokesh-qz6cc
    @lokesh-qz6cc 4 роки тому +1

    it is bit hard to follow your english pronunciation.

    • @MikesTechCorner
      @MikesTechCorner  4 роки тому +1

      I am sorry. I will try to improve. Join my discord server. links are in the latest videos. :-) Thx for watching.