Ship more detailed types? Codegen from OpenAPI-spec?
KATT opened this issue ยท 5 comments
Hey gang!
Looking at the typedefs of this SDK, I see a big void of actual type-safety:
Even looking at the docs I still don't know what different endpoints are supposed to return without actually invoking the call. The problem with that is that we won't have any reconciliation reports in our sandbox environment.
This example above is just in order to showcase and issue and grokking that is a separate issue.
Suggestion: You shouldn't need to manually write the implementation of every endpoint and instead be able to automatically generate a typesafe SDK based on your OpenAPI-schema using something like the openapi-generator.
Automating this would likely:
- Greatly reduce the amount of effort needed to put into this SDK
- Improve your quality of life maintaining it
- Remove inconsistencies between the actual API & this SDK
- Improve the experience for your customers
Hello checkout.com team,
Please don't do typechecking with primitives.
Do you manually handle/update your *.d.ts files?
Thanks for the feedback @christos97 Will look into updating this.
@KATT The very minimal type defs were intentional. You can use our API reference to see details about the payloads. We are also exploring generators or full types support as well.
Type safety reduces the maintenance burden on consumers of SDKs enormously. It would be great to see an improvement as suggested here.
We will try to implement this improvement soon.