Skip to content
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

Introduce util functions to convert query and header record with the http:Query and the http:Header annotations #7019

Closed
2 tasks
TharmiganK opened this issue Sep 23, 2024 · 0 comments · Fixed by ballerina-platform/module-ballerina-http#2153
Assignees
Labels
module/http module/openapi-tools Team/PCM Protocol connector packages related issues Type/Task

Comments

@TharmiganK
Copy link
Contributor

Description:

$Subject

This is a requirement from the OpenAPI generated code, where we support adding http:Header and http:Query annotations in the generated record types for query and header. In the client class we are using remote methods and have separate util functions to convert headers and queries to the required representations:

  • header record -> map<string|string[]>
  • query record -> query string

This functions should consider the name attribute from the http:Header and http:Query annotations. Since we cannot access the annotations in the record fields in the ballerina side, we need to write conversion functions in Java. These functions are added in the HTTP package

Describe your task(s)

  • Introduce a util function to convert a header record map to a map<string|string[]> with the names specified in the http:Header annotation (This function additionally does the conversion anydata -> string)
  • Introduce a util function to convert a query record map to a map<anydata> with the names specified in the http:Query annotation (There is no value conversion in this method)

Related Issues (optional):
#6867

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/http module/openapi-tools Team/PCM Protocol connector packages related issues Type/Task
Projects
Archived in project
1 participant