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

Verify correctness of endpoints with file parameters #99

Closed
macisamuele opened this issue Feb 5, 2020 · 1 comment · Fixed by #101
Closed

Verify correctness of endpoints with file parameters #99

macisamuele opened this issue Feb 5, 2020 · 1 comment · Fixed by #101
Assignees
Labels
bug Something isn't working

Comments

@macisamuele
Copy link
Collaborator

While working on #90 I was having troubles on writing a simple test that sends a file to the mock server.
This was mostly caused by the fact that the mock server is receiving the toString representation of the RequestBody and not its real content.

At this point I'm not 100% sure that the current plugin is able to generate proper retrofit APIs that allow file uploads.

The scope of this issue is to track the effort needed, if any, to ensure file upload capabilities.

@macisamuele macisamuele added the bug Something isn't working label Feb 5, 2020
@macisamuele macisamuele self-assigned this Feb 5, 2020
@macisamuele
Copy link
Collaborator Author

I do have some conclusive results over here.
I'm currently preparing a PR to address the issue and to write the missing tests of #90 .

According to the swagger specifications in order to send files the operation must consume multipart/form-data (doc). The junit-tests file endpoint does not define multipart/form-data and so the generate code does not work well.

Considering this we have two alternatives:

  1. Find a way to make it work anyway
  2. Stick to the swagger specifications and annotate the endpoint as unsafe so we will discourage usage of the endpoint.

I'm aiming to use the second alternative

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant