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

Constraints rules for NcDatatypeDescriptorStruct and associated NcFieldDescriptor need clarification #61

Open
jonathan-r-thorpe opened this issue Nov 19, 2024 · 0 comments

Comments

@jonathan-r-thorpe
Copy link
Contributor

In the case where a vendor has specified their own non-standard struct datatype, they have the opportunity to define NcParameterConstraints at the struct level, but can also define a NcParameterConstraint for each NcFieldDescriptor contained in the NcDatatypeDescriptorStruct definition.

This creates a potential conflict not covered by the specification.

Firstly a NcDatatypeDescriptorStruct can only meaningfully have a NcParameterConstraint containing a default value only (NcParameterConstraintNumber and NcParameterConstraintString are not applicable).

But if each of the contained NcFieldDescriptors also have constraints, which could possibly be NcParameterConstraintNumber or NcParameterConstraintString how do we reconcile the constraints?

Merging of the constraints at the struct and field level seems to be be against the maxim of "multiple levels of constraints implementations MUST fully override the previous level", even thought struct and field levels aren't explicitly mentioned in the current specification.

For the datatype definition my suggestion is that we only allow constraints at EITHER the struct level OR the field level.

There is then the question of whether struct properties with field level constraints can be overridden by property or runtime constraints. Given the property and runtime constraints can only override at the struct level, they cannot override at a field level and so should not be allowed i.e. struct datatypes with field level constraints CANNOT be overridden by property constraints or runtime constraints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant