Spring Boot Validate Incoming Json With Json Schema

preview_player
Показать описание
Enjoy! :-)
Thank you for commenting and asking questions.

Discord server - Where we discuss programming languages and tech - Please use the right channel to your input / question :)

Library sign up referral link:

The code is located here:
Follow me on twitter:
Chat on Discord:
Support me on Patreon:

Background nature video:
Video by Engin Akyurt from Pexels
Рекомендации по теме
Комментарии
Автор

Great video! Please explain how to validate json payload using annotations.

benstrydom
Автор

Thank you very much. Its very much informative.

madhavareddy
Автор

Thanks, Mike for a great tutorial. Can we validate (using this library) the JSON which contains a list of objects and get the positions for invalid ones?

iliabakanidze
Автор

Hi Mike,
Just wanted to know how this is different from the default validation provided by spring boot. I mean we can use @NotNull or such annotation by default in spring boot beans. Is there any additional functionality json schema brings in?

padmajanvenugopal
Автор

Hi Mike,
I have observed one issue with this code.
I am taking one model class(dto) as my controller class request(using @RequestBody Some ClassName request)
and calling the jsonvalidator service.
after calling the jsonvalidator service i am converting my incoming request to string using the ObjectMapper writeValueAsString method.
after that i have added all the logic which you have written but its failing to validate my json under the rules i have provided in schema.
Its not validating the type of data and its format.
Pls help me on this.

pls let me know if any details required for the above explanation.

Imjamalvali