-1

I want to validate the JSON file. I checked readValue from fasterXML but I see it return object. Is there any to validate JSON files efficiently without compromising performance?

public <T> T readValue(File src, Class<T> valueType)

Thank you

seenukarthi
  • 8,241
  • 10
  • 47
  • 68
Salman
  • 127
  • 1
  • 10
  • What's wrong with it returning an object? And what makes you think this has a performance problem? – user207421 Jun 16 '22 at 07:11
  • There is nothing wrong to return an object. The question is about performance and a better approach for validating JSON file. – Salman Jun 16 '22 at 07:18

1 Answers1

0

You could look at using a JSON Schema for validating the content of the file. networknt/json-schema is Java based and supports Jackson.

Ironluca
  • 3,402
  • 4
  • 25
  • 32