Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use (a subset of) JSON Schema to indicate required parameters for function calls #51

Open
stefandesu opened this issue Oct 20, 2022 · 0 comments

Comments

@stefandesu
Copy link
Member

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant