BAP to indicate elements needed with on_search/on_select/on_init/... #267
venkatramanm
started this conversation in
Proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When a bap fires a search, BPPs may return whatever they feel like (item_categories, provider catalog or just list of providers) but the BAP may expect certain elements to handle its UI Considerations. If there was a way to indicate the elements/fields BAP needs (kind of like graphql), BPP can make a more informed response.
Option 1:
BAP to form a json in the following fashion :
{
"json_path" : ["field1","field2",...]
}
for e.g
expectation = {
"./message/catalog" : [ "bpp/descriptor" , "bpp/fulfillments" , "bpp/providers" ]
"./message/catalog/bpp/providers[n]" : [ "items", "locations" ]
}
then pass in a header "X-ExpectedElements" : base64encoded(expectation)
BPPs can read and return accordingly.
Option2:
Another format could be like a template
expectation = {
"context" : {},
"message" : { "catalog" :
{ "bpp/descriptor" : {} ,
"bpp/providers" :[
{"locations" :[{ "id" :"" , "gps" : "" }],
"items":[{"id":"", "location_id":"", "descriptor": {} }]
}]
}
}
}
then pass in a header "X-ExpectedElements" : base64encoded(expectation)
Beta Was this translation helpful? Give feedback.
All reactions