Input Validation #9562
matekelemen
started this conversation in
Ideas
Replies: 3 comments 6 replies
-
|
@KratosMultiphysics/technical-committee has the JSON schema in mind for this pourpose |
Beta Was this translation helpful? Give feedback.
1 reply
-
Beta Was this translation helpful? Give feedback.
4 replies
-
|
I remember discussing about this in #653. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I like how the
Parametersclass validates the keys and value types of the input, but most of the time the values themselves have to go through a second round of validation on-site, where theParametersinstance is used (eg.: restrictingbuffer_sizeto positive integers).A friend of mine started working on a project that validates configuration files against a "schema", essentially restricting values with regular expressions. This allows constraining not only the types of the parameters, but also their values (eg.: ranges of values, specific strings, a certain set of characters, etc.). I think this is a neat idea that we could use too.
I know that
Parametersare heavily used in Kratos and there's no way to retroactively adapt every use case, but an extension toParameterscould be implemented with this functionality that could be used later on. Any thoughts on this?Example:
Current example:
Same example with suggested features:
Beta Was this translation helpful? Give feedback.
All reactions