You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The config file (aka metadata file) drives InGen. It is essential for the success of this project that this file is easy to write and understand. It is also important that the schema of the config file is versioned, so that users don't have to update their configs whenever a breaking change is introduced. Therefore, we should add versioning and schema validation to InGen.
Describe the solution you'd like
The config file is a YAML file which can be validated using jsonschema. A python library of the same name provides a way to do so. The following code snippet shows a schema that can validate any InGen config which has sources and interfaces defined. This example schema only validates the type of the required outer fields of a config file but shows the possibility of writing a comprehensive schema. Such a schema will ensure that any errors in the config file is detected early and the program fails fast if required. Writing the schema will also uncover some of the complexities of the current config design which can be improved in future versions.
---
title: Interface Generator Metadata Schemadescription: This is a sample schema that validates an InGen configtype: objectproperties:
interfaces:
type: objectpatternProperties:
".*":
type: objecttitle: interfaceproperties:
sources:
title: sourcesdescription: list of source identifierstype: arraycolumns:
title: columnsdescription: list of output columns and any formatter applied to themtype: arrayoutput:
title: outputdescription: properties of the interface outputtype: objectsources:
type: array
Describe alternatives you've considered
No alternatives considered yet.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
The config file (aka metadata file) drives InGen. It is essential for the success of this project that this file is easy to write and understand. It is also important that the schema of the config file is versioned, so that users don't have to update their configs whenever a breaking change is introduced. Therefore, we should add versioning and schema validation to InGen.
Describe the solution you'd like
The config file is a YAML file which can be validated using jsonschema. A python library of the same name provides a way to do so. The following code snippet shows a schema that can validate any InGen config which has
sources
andinterfaces
defined. This example schema only validates the type of the required outer fields of a config file but shows the possibility of writing a comprehensive schema. Such a schema will ensure that any errors in the config file is detected early and the program fails fast if required. Writing the schema will also uncover some of the complexities of the current config design which can be improved in future versions.Describe alternatives you've considered
No alternatives considered yet.
The text was updated successfully, but these errors were encountered: