-
Notifications
You must be signed in to change notification settings - Fork 4
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
openapi: Extend the /v1/compile
API
#108
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Philip Conrad <[email protected]>
Signed-off-by: Philip Conrad <[email protected]>
This commit adds a response type for the /v1/compile API, and begins extending it for supporting more output formats than just the JSON AST format. Signed-off-by: Philip Conrad <[email protected]>
openapi/openapi.yaml
Outdated
type: array | ||
targetFormat: | ||
type: string | ||
enum: [json_ast, sql, ucast] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we may need further per-targetFormat options?
For example "ucast" would have different valid inputs (PE fragment) depending on whether it's meant for conversion with ucast.as_sql
, or ucast-linq or ucast-prisma. Could be a "flavour", akin to database dialects? 🤔
Same for SQL, if we want to expand the set of builtins that we can translate, this could depend on the target dialect, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, that's a good point. 🤔 I suppose we could switch this to be an object type or something that allows us to nest target-specific options.
I was interested in seeing if we could actually separate out the response types for different targets into different I don't want to overload the response to just generic arbitrary JSON |
This commit also includes a small change to include table mapping info for the SQL targets. Signed-off-by: Philip Conrad <[email protected]>
Signed-off-by: Philip Conrad <[email protected]>
What changed?
This PR tracks a planned extension to the Enterprise OPA
/v1/compile
API, as part of our intended support for UCAST and data filtering experiments.Currently, my approach is to add a single additional string option under
"options"
➡️"targetFormat"
. Allowed values for the field include:json_ast
(the default),sql
, anducast
.Here's what an example
/v1/compile
input might look like:The response would then resemble: