-
Notifications
You must be signed in to change notification settings - Fork 21
Description
I'm using gapic-generator-typescript to generate client-side REST fallback methods from protobuf.
which internally depends on gax-nodejs.
when requesting "Post" method with body, it works fine. but when i use "Get" method with query string
(to support pagination features like page_size, page_token), it sends camelCased query string.
https://my-domain.com/api/v1/taskGroups/-/tasks?pageSize=10
so when i checked implemented code on this module, it works like this.
in comment, it says "use camel case for query string".
// transcoding.ts
export function transcode(
request: JSONObject,
parsedOptions: ParsedOptionsType,
requestFields?: {[k: string]: Field}
): TranscodedRequest | undefined {
...
const queryStringObject = deepCopy(request); // use camel case for query string
...
const queryStringComponents =
buildQueryStringComponents(queryStringObject);
const queryString = queryStringComponents.join('&');
...
}I'm wondering why gax-nodejs formats query string as "camelCase". because in google aip examples,
it seems like query string would be "snake_case". (https://google.aip.dev/127)
// The user-specified ID for the book.
// When using HTTP/JSON, this field is populated based on a query string
// argument, such as `?book_id=foo`. This is the fallback for fields that
// are not included in either the URI or the body.
string book_id = 3;If you have any ideas of supporting snake_case in queryString?
(By the way, i forked this repository and use camelToSnakeCase Method to make query string snake _case)