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
The schemas annotation supports inlined schema definitions (undocumented).
# METADATA# scope: package# schemas:# - input: {"type": "boolean"}package main
Currently, the schemas annotation only affect type checking if the --schema flag is passed to the eval- and check commands. Considering the --schema requires you to supply a file or directory, its use is redundant and confusing when only inlined schemas are used.
Currently, annotation parsing is only triggered when the --schema flag is used, or if a rego.metadata.* function is called within the policy. Consider introducing a new flag for enabling use of inlined schemas, to make it possible to opt-out of unwanted annotation parsing.
Note: This functionality has limited use while inlined schemas remain undocumented.
The text was updated successfully, but these errors were encountered:
srenatus
changed the title
Respect inlinet schemas annotations even if --shema flag isn't used
Respect inlined schemas annotations even if --schema flag isn't used
Jan 2, 2023
Always parse annotations.
Always use `schemas` annotations with inlined schemas for type checking.
Ignore `schemas` annotations with schema refs if no `--schema` flag was provided.
Enabled for commands:
* eval
* check
* test
Fixes: open-policy-agent#5506
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
Always parse annotations.
Always use `schemas` annotations with inlined schemas for type checking.
Ignore `schemas` annotations with schema refs if no `--schema` flag was provided.
Enabled for commands:
* eval
* check
* test
Fixes: open-policy-agent#5506
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
* ast: Enforce inlined schemas without --schemas flag
Enabled for commands:
* eval
* check
* test
Always parse annotations.
Always use `schemas` annotations with inlined schemas for type checking.
Ignore `schemas` annotations with schema refs if no `--schema` flag was provided.
Fixes: #5506
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
The
schemas
annotation supports inlined schema definitions (undocumented).Currently, the
schemas
annotation only affect type checking if the--schema
flag is passed to theeval
- andcheck
commands. Considering the--schema
requires you to supply a file or directory, its use is redundant and confusing when only inlined schemas are used.Currently, annotation parsing is only triggered when the
--schema
flag is used, or if arego.metadata.*
function is called within the policy. Consider introducing a new flag for enabling use of inlined schemas, to make it possible to opt-out of unwanted annotation parsing.Note: This functionality has limited use while inlined schemas remain undocumented.
The text was updated successfully, but these errors were encountered: