2

I have need to validate incoming POST jsons in my project. This is a part of a RESTFul json service i am developing. These jsons need to be validated for

  1. mandatory attributes
  2. invalid attributes
  3. data types

Just read about json-schema-validator and it looks good.

Has anyone used this in maven/spring projects? Is there any better (ito - API, stability) tool that i can use?

Update - i am also looking at json tools

Sabir Khan
  • 9,826
  • 7
  • 45
  • 98
gotz
  • 539
  • 2
  • 8
  • 23

2 Answers2

4

Disclaimer: author of https://github.com/fge/json-schema-validator here...

This library has no dependency on anything web-related, so you can use it in a bare-bones Java application, a servlet-only Java application (I have even made one) or with Spring. It won't be a problem.

Hope this helps!

fge
  • 119,121
  • 33
  • 254
  • 329
1

Look for the http://code.google.com/p/jsonschema/. This might solve your issue.

Also refer JSON schema validation using java

Community
  • 1
  • 1
Prathap
  • 717
  • 2
  • 8
  • 25