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

Validation of data provided for execution of an action #3623

Closed
Tracked by #3648
chenejac opened this issue Feb 8, 2022 · 2 comments
Closed
Tracked by #3648

Validation of data provided for execution of an action #3623

chenejac opened this issue Feb 8, 2022 · 2 comments

Comments

@chenejac
Copy link
Contributor

chenejac commented Feb 8, 2022

Describe the solution you'd like
Data provided by users for execution of an action should be encapsulated into OperationData. It should be provided for the certain steps in the custom action, and before it is executed, a validation should be performed. Validators for Parameters are defined in the RDF representation of an action.

Describe alternatives you've considered
A part of validation might be moved in the later phase on client side and performed within JavaScript code (e.g. isNotNull)

Additional context
https://github.com/litvinovg/Vitro/tree/dynapi/api/src/main/java/edu/cornell/mannlib/vitro/webapp/dynapi/components/validators

@chenejac
Copy link
Contributor Author

chenejac commented Feb 8, 2022

Probably an interface might be defined for elements which should be validated (similarly as Removable and derrefence, or RunnableComponent and run). The other option might be to extend RunnableComponent with validate method, which basically will pass through associated validators and invoke isValid method.

Can we introduce notation for definition validation rules or use some existing notation to make list of validators easy for customization by non-Java developers?

@litvinovg
Copy link
Collaborator

There are data types and data formats in OpenAPI Specification. I think we should use formats to specify RDF data types and other restrictions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants