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
-
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
-
I like how the
Parameters
class 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 theParameters
instance is used (eg.: restrictingbuffer_size
to 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
Parameters
are heavily used in Kratos and there's no way to retroactively adapt every use case, but an extension toParameters
could 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