Skip to content

expansion of the client's autogen object (client/client.gen.ts) with getValidRequestBody #3151

@salisbury-espinosa

Description

@salisbury-espinosa

Description

current implementation:

return {
    buildUrl,
    connect: makeMethodFn('CONNECT'),
    delete: makeMethodFn('DELETE'),
     ....... 
     ....... 
} as Client;

It would be great to add getValidRequestBody (from '../core/utils.gen') just like buildUrl.

Reason: to be able to assemble all parts of a request when needed before executing the request itself.
For example, this is necessary if the code contains auto-filled fields that rely on serialization of the entire request body (for example, if a signature is performed using some algorithm).
This logic could, of course, be left in interceptors (client.interceptors.request.use(...) , but then

  1. the request would be implicitly modified.
  2. I would like to use autogenerated SDK methods so that the call is type-safety and all auto-filled fields are explicitly filled

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions