-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
fix(js-client): handle type definitions for request body params (#6018)
* fix(js-client): handle type definitions for requestBody Handling type definitions for requestBody in API schema while still taking into consideration optional / void params if all path, query, and requestBody keys are optional. * fix(js-client): add reference docs links and code example to NetlifyAPI client definition comment Improve DX by adding links to docs and small code sample. * fix(js-client): add types for request body json and octet stream - combined the request body type with the Params type - handle cases where request body properties are optional - handle cases where all params and request body are optional - allow 'application/json' body to be a JSON object or a function returning one - allow 'application/octet-stream' body to be a Node.js ReadStream or a function returning one - simplify by extracting repetitive logic to helper types like `IsParamsOrRequestBodyRequired` and `IsRequestBodyOptional` etc. * refactor(js-client): rename RequestBodyDecorator to DetailedRequestBody 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.
- zip-it-and-ship-it-v9.43.1
- zip-it-and-ship-it-v9.43.0
- zip-it-and-ship-it-v9.42.6
- zip-it-and-ship-it-v9.42.5
- zip-it-and-ship-it-v9.42.4
- netlify-v13.3.3
- netlify-v13.3.2
- netlify-v13.3.1
- functions-utils-v5.3.8
- functions-utils-v5.3.7
- functions-utils-v5.3.6
- functions-utils-v5.3.5
- functions-utils-v5.3.4
- config-v20.22.0
- config-v20.21.7
- config-v20.21.6
- config-v20.21.5
- build-v29.59.2
- build-v29.59.1
- build-v29.59.0
- build-v29.58.10
- build-v29.58.9
- build-v29.58.8
- build-v29.58.7
- build-v29.58.6
- build-v29.58.5
- build-info-v8.1.0
1 parent
ad7715b
commit e2e9114
Showing
2 changed files
with
135 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters