-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Extracting available built-in functions from the serialized form of OPA's capabilities struct (i.e. a "capabilities.json" file) provides applications most of the data they'll need about any given built-in function. However, this data crucially does not include the deprecated attribute, as that's not an exported field on the struct. Applications integrating via the Go API can use the IsDeprecated method to get this information (although why that's needed when e.g. Nondeterministic is an exported field, I don't know), but that obviously does little to help other types of integrations making use of capabilities.
My suggestion is that the deprecated field is renamed Deprecated, and that at least built-ins where this value is true includes that data in their serialized form.
If there are any concerns around adding a new exported field to the built-in struct, then we could at least consider custom JSON marshalling/unmarshalling methods that includes this field in serialization.