Skip to content

Fix return type declaration for refund method#76

Open
vendra95 wants to merge 1 commit into
sumup:mainfrom
vendra95:main
Open

Fix return type declaration for refund method#76
vendra95 wants to merge 1 commit into
sumup:mainfrom
vendra95:main

Conversation

@vendra95

Copy link
Copy Markdown

This method return a value

@matoous

matoous commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Hi @vendra95 , thanks for your contribution. Could you please elaborate what the issue is with the current type annotation for the method? The SDK code is generated from OpenAPI specs, so if the null is wrong we need to fix it in the code generator or update the OpenAPI specs that the code is generated from.

@vendra95

Copy link
Copy Markdown
Author

Thanks for the clarification.

The issue is with the method's return type declaration.

The method currently declares : null. However, the implementation explicitly returns the result of ResponseDecoder::decodeOrThrow(...):

return ResponseDecoder::decodeOrThrow(...);

So there is an inconsistency between the declared return type and the implementation.

@TheLambdaFunction

Copy link
Copy Markdown

Hi @vendra95 , thanks for your contribution. Could you please elaborate what the issue is with the current type annotation for the method? The SDK code is generated from OpenAPI specs, so if the null is wrong we need to fix it in the code generator or update the OpenAPI specs that the code is generated from.

Hello @matoous,
The only issue I can see with the generator "script" is that it ignores the output directory argument, maybe it's expecting it as a flag rather than a positional argument, but that should be reflected in its README file.

As per the core issue: it's an issue with the interaction between the API and the generated code.
It is not clear to me why the refund endpoint returns nothing on success, but returns on the other hand an error JSON body in case of issues. Either return always something that can be decoded or update the generator so that it can produce methods that handle empty responses accordingly (which I think is going to give more issues in the future if anything)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants