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

Add External Validation rules to Dynamic Schema Options #871

Open
joneubank opened this issue Oct 21, 2024 · 0 comments
Open

Add External Validation rules to Dynamic Schema Options #871

joneubank opened this issue Oct 21, 2024 · 0 comments

Comments

@joneubank
Copy link
Contributor

joneubank commented Oct 21, 2024

This ticket is contributing to the epic: #863

Summary of External Validation

We are adding a mechanism to validate that a property of an analysis, for example a donor ID, is registered in an external registry. This validation will be done during Analysis submission by making a web request to a configurable URL, and it will ensure that the value of a property is valid according to the external service.

External validation may be done to ensure that an ID is registered in another meta data service, or could be looking up a value in an external ontology, or any other validation logic that the external service chooses.

Ticket Details

A SONG administrator can add external validation rules to any dynamic schema. These rules specify a property in the dynamic schema that requires external validation, and the URL that will handle the validation request.

These rules are added to the options property in the request to the Dynamic Schema create and update endpoints. The property options.externalValidation will contain an array of objects that define these rules. Example options object with this property:

{
	"fileTypes": ["bam", "cram"],
	"externalValidation": [
		{
			"jsonPath": "experiment.participant.participant_id",
			"url": "http://lyric.example.com/validate/participant_id"
		},
		{
			"jsonPath": "experiment.clinic.clinic_id",
			"url": "http://lyric.example.com/validate/clinic_id"
		}
	]
}

External Validation property validation rules

  • externalValidation property is optional. If no value is given, or the value is an empty array, then no external validation rules are recorded.
  • Every entry in the externalValidation array must be a JSON object with two properties: jsonPath, and url
    • jsonPath represents the path to the property that will be validated using an external service
      • this value must be a string, cannot be empty
      • the value in this string will be a path to a property in the dynamic schema, with properties separated by period . characters
      • the value received should be checked against the dynamic schema. If the property defined here is not found in the dynamic schema than the request to update or create the dynamic schema should be rejected
    • url is the http url that will be used to validate values for that property
      • we must validate that the URL is a properly formatted URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants