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
Allow custom builtin function to provide a description #6449
Labels
Comments
A workaround is to call rego.RegisterBuiltin1(&decl, ...)
ast.RegisterBuiltin(&ast.Builtin{
Name: decl.Name,
Description: "My descripition",
Decl: decl.Decl,
Nondeterministic: decl.Nondeterministic,
}) |
Seems fine to update the |
lcarva
added a commit
to lcarva/opa
that referenced
this issue
Dec 1, 2023
Fixes: open-policy-agent#6449 Signed-off-by: Luiz Carvalho <lucarval@redhat.com>
lcarva
added a commit
to lcarva/opa
that referenced
this issue
Dec 1, 2023
This allows processes, such as doc generation, to have additional information about custom builtin functions. Fixes: open-policy-agent#6449 Signed-off-by: Luiz Carvalho <lucarval@redhat.com>
lcarva
added a commit
to lcarva/opa
that referenced
this issue
Dec 4, 2023
This allows processes, such as doc generation, to have additional information about custom builtin functions. Fixes: open-policy-agent#6449 Signed-off-by: Luiz Carvalho <lucarval@redhat.com>
lcarva
added a commit
to lcarva/opa
that referenced
this issue
Dec 4, 2023
This allows processes, such as doc generation, to have additional information about custom builtin functions. Fixes: open-policy-agent#6449 Signed-off-by: Luiz Carvalho <lucarval@redhat.com>
lcarva
added a commit
to lcarva/opa
that referenced
this issue
Dec 4, 2023
This allows processes, such as doc generation, to have additional information about custom builtin functions. Fixes: open-policy-agent#6449 Signed-off-by: Luiz Carvalho <lucarval@redhat.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the underlying problem you're trying to solve?
I would like to generate documentation for the custom builtin rego function provided by a certain project, see example. To achieve this, I can iterate through the
ast.Builtins
slice to extract information about each function, such as name, args, and results. From that, I can format the data as needed. The limitation I'm having is not being able to set a description for the custom rego functions.Describe the solution
When registering a builtin function, allow a description to be set, maybe here. So that custom builtin functions have the
Description
attribute set.The text was updated successfully, but these errors were encountered: