fix: make body in readChanges optional #62
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
We currently require passing an object with
type
as an empty string when calling theOpenFgaClient.readChanges
, this is because we do not mark thebody
param as optional, when in reality it is as it is not required to pass atype
to the api, and based on our other SDKs this seems a perfectly valid usage.This is only really obvious when using TypeScript as it will flag the issue, developers who aren't using TypeScript won't see anything wrong until their code runs and the SDK errors when trying to access
body.type
.This PR proposes moving the
body
parameter to be optional, meaning that the above is now valid from a typechecking perspective and guards the property access so no runtime errors occurIt also includes a commit that updates the docstring on the
read
API as made in openfga/api#133 so that we don't have lingering changesReferences
Generated from openfga/sdk-generator#304
Review Checklist
main