-
Notifications
You must be signed in to change notification settings - Fork 11
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
support jq based response transformation in SmartAPI annotations #521
Comments
Based on yesterday's meetings, we are working towards this issue and the "general JQ support" together. The api-response-transform PR seems to include support for both issues, while the smartapi-kg PR seems specific to this issue. The main discussions with likely happen in #489. Our plan is to move external APIs (non-BioThings, non-TRAPI, or not made by our lab) to having JQ-support in the SmartAPI yamls. See this post for more details |
We've now decided that we're going to separate the "basic JQ in BTE" support #489 from this issue (ref: Jackson's post and Chunlei's reply), because there may be more refactoring needed to make this issue easier to use. I'm linking some discussion from #489 that's relevant to this issue.
|
However, we have worked on "JQ in SmartAPI". Here's where we are:
|
And a piece of feedback I have: the field-name in x-bte annotation is currently |
The smartapi-kg PR is tied to this issue. And there's some thoughts on how code for this issue would be deployed in the future in the other issue, and I'll paste them here:
|
And some of my notes on how to test "JQ in SmartAPI yamls / x-bte annotation". Not sure if it'll be relevant once we are ready to proceed click to expand
Test "JQ in SmartAPI" Process:
Note: CTD uses a "pair" string, which is a way to test that it works |
and a note from our discussion of x-bte refactoring: JQ in SmartAPI is maybe for "basic post-processing" only. And more "mental model" or complex stuff should stay in BTE (I'm not sure what "mental model" means here now...). Since we want to avoid making the x-bte annotation writing harder/more-complicated and more like code... |
In issue #489, @rjawesome evaluated both JMESPath and
jq
, then decided to usejq
as the JSON transformation engine for it richer functionality.This issue continues the implementation in PR38 for issue #489 to provide an option for users to include
jq
based response transformation directly in an API's SmartAPI annotations. The genericJQTransformer
will take the providedjq
string and performance the transformation.The text was updated successfully, but these errors were encountered: