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

Null safety? #1324

Closed
rekire opened this issue Jul 18, 2024 · 2 comments
Closed

Null safety? #1324

rekire opened this issue Jul 18, 2024 · 2 comments

Comments

@rekire
Copy link

rekire commented Jul 18, 2024

I'm still orientating your APIs, since there are not much code samples in your documentation (byside of the REST-Calls). I started checking your SDK code. Did I just check out the wrong classes or are there really no null safety annotations?

To be honest that is one of the main reasons for me to use a SDK to have a clear interface which tells you which fields you can expect and which not.

@jillingk
Copy link
Contributor

Hi @rekire,

Thanks for reaching out here and hope you had a great experience orientating our APIs! As to you comment about null safety, I get where you are coming from. Usually in any java web-application this would be a very crucial aspect to include in order to prevent NPEs, and we most certainly do this in our own codebase(s).

However, this library is inherently null safe, which is why we chose to omit any such safety checks I suppose. This, because we mostly generate the request/response models from OpenAPI specifications which have been proven over time (and after some tinkering) to be quite reliable. Furthermore the inherent nature of interacting with APIs means, you should always be weary of what responses one can get based on the triggered flow for a certain endpoint. E.g. we could make pretty much all response fields in our library have the @CheckForNull or @Nullable annotation if you aggregate over all the different kinds of responses you can expect from a single endpoint. This would defeat the purpose of having these safety annotations in the first place I believe.

Let me know if this reasoning makes sense or if you think there's still a distinct use case for this. I'd be happy to hear your opinion about this!

Best, Jilling
Adyen

@rekire
Copy link
Author

rekire commented Sep 19, 2024

That is fine. One team mate decided to implement the REST-API in pure dart. Works very well and makes it easier to test the communication on the development machines. The API is much cleaner then other terminals we came across. Nice work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants