Skip to content

Commit

Permalink
refactor(js-client): rename RequestBodyDecorator to DetailedRequestBo…
Browse files Browse the repository at this point in the history
…dy for clarity

These types are responsible for adding detailed annotations to the
`body` parameter of API methods, such as describing its usage and
examples for `application/json` and `application/octet-stream`. The new
names make their purpose more explicit and improve readability for
future maintenance and usage.
  • Loading branch information
CalebBarnes committed Jan 16, 2025
1 parent 7b7a6bd commit dc02142
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/js-client/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ type IsRequestBodyOctetStream<K extends keyof operations> = 'requestBody' extend
type RequestBodyParam<K extends keyof operations> =
HasRequestBody<K> extends true
? IsRequestBodyOptional<K> extends true
? RequestBodyDecoratorOptional<K>
: RequestBodyDecorator<K>
? DetailedRequestBodyOptional<K>
: DetailedRequestBody<K>
: never

type RequestBodyDecorator<K extends keyof operations> =
type DetailedRequestBody<K extends keyof operations> =
IsRequestBodyJson<K> extends true
? {
/**
Expand All @@ -115,7 +115,7 @@ type RequestBodyDecorator<K extends keyof operations> =
}
: never

type RequestBodyDecoratorOptional<K extends keyof operations> =
type DetailedRequestBodyOptional<K extends keyof operations> =
IsRequestBodyJson<K> extends true
? {
/**
Expand Down

0 comments on commit dc02142

Please sign in to comment.