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

[BUG] [scala-sttp] api.mustache template specifies the incorrect return type #13077

Closed
6 tasks done
reddicj opened this issue Aug 4, 2022 · 2 comments
Closed
6 tasks done

Comments

@reddicj
Copy link

reddicj commented Aug 4, 2022

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

The return type of each operation is incorrect. Currently the template defines it as this:

def {{operationId}}({{>methodParameters}}): Request[{{#separateErrorChannel}}Either[ResponseException[String, Exception], {{>operationReturnType}}]{{/separateErrorChannel}}{{^separateErrorChannel}}{{>operationReturnType}}{{/separateErrorChannel}}, Nothing] =

But it should be this:

def {{operationId}}({{>methodParameters}}): Request[{{#separateErrorChannel}}Either[ResponseException[String, Exception], {{>operationReturnType}}]{{/separateErrorChannel}}{{^separateErrorChannel}}{{>operationReturnType}}{{/separateErrorChannel}}, Any] =

i.e. Nothing should be Any

openapi-generator version

6.0.1

OpenAPI declaration file content or url
Generation Details

Using Coursier launch:

 cs launch org.openapitools:openapi-generator-cli:6.0.1 -- generate \
  -i api.yaml \
  -g scala-sttp \
  -o out
Steps to reproduce

See the sttp docs:
https://sttp.softwaremill.com/en/latest/requests/type.html

Related issues/PRs
Suggest a fix

Suggested above.

@reddicj
Copy link
Author

reddicj commented Aug 5, 2022

I see this issue is fixed in this PR #11949.

@fserra-mdsol
Copy link

This has not been fixed yet, as the PR with the fix has not been merged

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