Generated unions fail to enforce patterns
Description
Environment
None
Activity
Show:

Robert Varga January 18, 2024 at 4:43 PM
So this really needs to be addressed in one go with – there are just too many open cases we need to cover. See mdsal405.yang for detailed use cases.

Robert Varga February 16, 2021 at 4:34 PM
This and related issues may be resolved as part of adoption of yangtools-7. We'll see when that effort is complete.

Robert Varga December 14, 2018 at 3:36 PM
PATTERN_CONSTANTS needs to remain publicly-visible, though deprecated. We need to define a new per-leaf constant schema, which will mimic what is being done, albeit in private. Furthermore PATTERN_CONSTANTS should not be compiled into enforcement patters.
The following snippet, taken from openconfig-bgp-policy.yang:
results in the following code:
Note there is a useless check_stringLength() emitted, which is probably fine. What is not fine is that the String enforcement is completely missing, eventhough we have generated the appropriate regexs constant.