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
…nd `patternProperties`
There are a couple of issues with the jsonschema-generated code for
`additionalProperties` and `patternProperties`. It generates an extra
regexp to exclude fields that have been explicitly defined, but
it does not quote regexp metacharacters in that pattern (#3551).
When fixing that, I also realised that it does the wrong thing
for empty fields, because it does not omit the constraint when
there are no fields.
Changing the logic here exposed a bug (#3555) in the v2 evaluator where
the following expression would not give an error, even though
`"BAD)"` is not a valid regexp. The regressions in the jsonschema
tests are because of that.
Fixes#3551
Signed-off-by: Roger Peppe <[email protected]>
Change-Id: I0e21828f679eaf39afd81eaa38d8035ea3d93c71
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1203588
Unity-Result: CUE porcuepine <[email protected]>
Reviewed-by: Daniel Martí <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Issue #3555 shows that invalid regular expressions are ignored
in some circumstances. To avoid differences between evalv2 and evalv3
(and to enable better behaviour when `strictFeatures` is disabled),
check all regular expressions up front rather than relying on the
evaluator to detect them later.
Also detect invalid character classes specifically because that's
something which is technically a missing feature rather than
an invalid regexp.
Signed-off-by: Roger Peppe <[email protected]>
Change-Id: I616c991bccd82ddcb9c2070404b352f686f58aeb
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1203589
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Daniel Martí <[email protected]>
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest stable release?
Yes (v0.10.0)
What did you do?
What did you expect to see?
A passing test. The regular expression
BAD)
has invalid syntax and should be rejected up front.evalv3
behaves correctly here.What did you see instead?
The text was updated successfully, but these errors were encountered: