For example, many calls to getMappings require either parameter from or to to be given. There are certain cases in which Cocoda is calling getMappings even though not all required parameters are available because it doesn't know which are required. It would be nice if client applications could detect beforehand which parameters are required.
The big question is how we should implement the validation for these Schemas. If we use only a very specific subset of JSON Schema features, we could write a very simple validation method and add it to cocoda-sdk so that no additional dependencies are needed. Validation code could also be generated by Ajv during build time. I haven't tested it, but the resulting validation code should be really small.
Other options if we're willing to add a dependency:
For example, many calls to
getMappings
require either parameterfrom
orto
to be given. There are certain cases in which Cocoda is callinggetMappings
even though not all required parameters are available because it doesn't know which are required. It would be nice if client applications could detect beforehand which parameters are required.The big question is how we should implement the validation for these Schemas. If we use only a very specific subset of JSON Schema features, we could write a very simple validation method and add it to cocoda-sdk so that no additional dependencies are needed. Validation code could also be generated by Ajv during build time. I haven't tested it, but the resulting validation code should be really small.
Other options if we're willing to add a dependency: