Closed NielsKorschinsky closed 1 year ago
I want also to use this issue report to highlight that I really like the fact that typing was applied at all. Also, the way you can interact with the API is very smooth and good to handle. Thanks a lot for providing the API!
Hi @NielsKorschinsky, thanks for this feedback! Since our SDK is generated from an OpenAPI spec, we don't directly modify several of the files including the CloudantV1
class methods. We will consider passing along your type changes to the team that manages the OpenAPI spec generator for future enhancements.
Hi @NielsKorschinsky! FYI: The typing was improved on our latest (v0.7.0) version.
Describe the bug
Hi,
This is more of a "Flavor" bug report, as I know the current existing syntax is allowed by some linters. However, if using strict typing, the current way the methods are typed causes issues and enforces me to use
# type: ignore
, which is not preferable, as this will also disable actual type issues.You are using method headers like:
The issue is, that you have there elements like
limit: int = None,
This already conflicts, as limit is not set to be anOptional[int]
. If using an optional int to access this method, my linter is correctly showing me an issue, as the types conflict.If used correctly, either the type should be all changed to Optional, or the provided value should be the correct value to disable/default behavior of said argument.
To Reproduce
limit
argument, therefore setting it to NoneExpected behavior
The method header is either has the correct types or uses default/disable values which fits the expected types.
Screenshots
Must gather (please complete the following information):
Additional context