Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ship more detailed types? Codegen from OpenAPI-spec? #277

Open
KATT opened this issue Sep 12, 2022 · 5 comments
Open

Ship more detailed types? Codegen from OpenAPI-spec? #277

KATT opened this issue Sep 12, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@KATT
Copy link

KATT commented Sep 12, 2022

Hey gang!

Looking at the typedefs of this SDK, I see a big void of actual type-safety:

Screenshot 2022-09-12 at 16 23 05

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
@christos97
Copy link

Hello checkout.com team,

Please don't do typechecking with primitives.
Do you manually handle/update your *.d.ts files?

source

TypeScript_ Documentation - Do's and Don'ts

@ioan-ghisoi-cko
Copy link
Contributor

Thanks for the feedback @christos97 Will look into updating this.

@ioan-ghisoi-cko
Copy link
Contributor

@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.

@tbartley
Copy link

Type safety reduces the maintenance burden on consumers of SDKs enormously. It would be great to see an improvement as suggested here.

@armando-rodriguez-cko armando-rodriguez-cko self-assigned this Aug 17, 2023
@armando-rodriguez-cko armando-rodriguez-cko added the enhancement New feature or request label Aug 17, 2023
@armando-rodriguez-cko
Copy link
Contributor

We will try to implement this improvement soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

5 participants