-
Notifications
You must be signed in to change notification settings - Fork 6k
The type or namespace name 'ByteArray' could not be found #1278
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
Comments
@patrickjrs For C#, file is mapped to "Stream": https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java#L75 Ae you using the latest version (master)? Can you also share the spec with us? |
@wing328 Thanks for getting back to me. I grabbed the latest master version today. Our api is currently behind a VPN so cannot share it yet. For multipart/form-data requests the file parameter seems to be mapped to Stream. We also have straight binary uploads of files when no metadata is needed in the request, in this case we would write the file bytes to the body of the request. According to this PR it should work but maybe it's outdated already: swagger-api/swagger-core#1335 |
@patrickjrs format To workaround the issue for the time being, what about using type |
@wing328 If you plan to support it on C# client at some point I'd rather wait for that than change the current contract of our api, or could we use "file" without it generating a multipart/form-data request? |
@patrickjrs if |
@patrickjrs sorry I was wrong. The API client would still use
In your case, is it correct to say the server is expecting |
@wing328 Yes, that's correct, for this particular action the server expects application/octet-stream |
@patrickjrs I would like to get this support in the C# client but may not have time recently. If you've some cycle to submit a PR to add the support of byte array in C# API client, I can work with you and give you some directions to begin with. |
@patrickjrs I've submitted #1864 to add "binary" support for C# client. I wonder if you can perform a test when you've time. |
PR merged into master. Closing this issue for the time being. |
When trying to generate binary file upload code in C# based on swagger spec the file parameter type is set to ByteArray instead of byte[]. This breaks compilation.
The text was updated successfully, but these errors were encountered: