Interpol differs from json schema in a couple ways:
additionalProperties: false is the default in interpol; in json-schema it defaults to true
required: true is the default in interpol (overridable with optional: true); in json-schema required defaults to false
- If the
scalars_nullable_by_default option is true, then scalars will get a schema type like [ integer, null ] rather than just integer.
The way we currently accomplish this is to walk the schema of each endpoint and mutate it, adding the necessary properties to get the behavior we want.
However, this approach can be quite slow: in our app we have over 130 endpoint definitions, and it takes about 2 seconds to load all of them, largely because interpol is walking the schema definitions in each. This makes some of our tests quite slow :(. If, instead, we used a custom validator it wouldn't need to walk the schema up front and could be much faster.