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

Responses without body/content does not work #31

Open
ashwini-desai opened this issue Aug 17, 2020 · 2 comments
Open

Responses without body/content does not work #31

ashwini-desai opened this issue Aug 17, 2020 · 2 comments
Labels

Comments

@ashwini-desai
Copy link
Collaborator

ashwini-desai commented Aug 17, 2020

Problem:
Certain HTTP status do not have a response body like 201(response body optional) and 204. But currently, specific yml without response content results in codegen failure.

Tech Details:

  1. Fails in ResponseBodyParser.kt where we do r.value.content?.values!!. values in not present for contents without body.

Expected Behaviour:

  1. Response body should be made optional.
  2. Controller 's method should also not have any return type (this could be tricky)
@AniketSK
Copy link

AniketSK commented Oct 2, 2020

I'd like to take a look at this. Could you elaborate on point 2?

@ashwini-desai
Copy link
Collaborator Author

Hey @AniketSK ,

Controller's response today is set to HttpResponse where T is picked with some logic. This will have to be changed for the status which do not have response body. It might be tricky based on how open api parser returns the responses.

Looking at code bit more would help understand what I mean above.

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

No branches or pull requests

2 participants