Luis Abreu
Luis Abreu

Reputation: 4504

What's the reccommended approach for building a json schema file for complex types

We're trying to use json schema to validate the values our API's can receive (POST and PUT) and I'm wondering about the recommended approach for exposing several types. Currently, we're using a single JSON schema file that uses $ref to reference other type definitions that are specified on the $defs section of the schema, but there are some which think that we should move each type definition into its own file.

Since we don't have a lot of experience with JSON schema validation, I was wondering if you've found any issues in production when you have the schema for all your types distributed accross several files (ex.: I know that waf can do json schema validation, but not sure if having several json schemas where one schema refs another is something they can handle).

Thanks.

Upvotes: -1

Views: 15

Answers (0)

Related Questions