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

File upload missing #10

Open
Ronsku opened this issue Mar 27, 2017 · 1 comment
Open

File upload missing #10

Ronsku opened this issue Mar 27, 2017 · 1 comment

Comments

@Ronsku
Copy link

Ronsku commented Mar 27, 2017

I have a problem with file upload through formData with generated openapi-client.

  • I create a new post with type 'file':

screen shot 2017-03-27 at 15 43 12

  • All good in swagger UI:
    screen shot 2017-03-27 at 15 45 13

  • openapi-client generates Typescript type error "[ts] Cannot find name 'file'.":

screen shot 2017-03-27 at 15 41 51

  • I resolved the type error by having "file" replaced with "File" (big F https://developer.mozilla.org/en/docs/Web/API/File) with following PR Feature/add type file #11.

  • But the actual file upload still doesn't work since request headers doesn't get Content-Type: "multipart/form-data" and there is no request payload either.
    screen shot 2017-03-27 at 15 49 59

  • It should look something like this to work:
    screen shot 2017-03-27 at 15 53 07
    screen shot 2017-03-27 at 15 56 12

  • File upload feature would be very handy to have in this openapi-client!

@mikestead
Copy link
Owner

@Ronsku Thanks for the details!

Currently I've only added / tested support for JSON (mentioned in the README).

Full multipart support shouldn't be too hard to add but I don't have a lot of time right now to work on and thoroughly test it.

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