You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When response schema contains binary format for representing byte [] array similar like in the sample, autorest should generate method with return type byte[]
But it generates method with return type string which tries to convert binary array of bytes to string and when method is called, the exception is raised.
Did you get anywhere with this having the same issue @xplicit . At moment am thinking might have to convert end point to return base64 encoded data but not ideal
Is the whole response a byte array? if so, you should use stream for the response.
Otherwise, if the response is a json with embedded binary data, ... you have to encode it as a string. JSON doesn't support directly embedded binary data.
Uh oh!
There was an error while loading. Please reload this page.
When response schema contains
binary
format for representingbyte []
array similar like in the sample, autorest should generate method with return typebyte[]
autorest/Samples/petstore/petstore.json
Lines 278 to 284 in 32b3008
But it generates method with return type
string
which tries to convert binary array of bytes to string and when method is called, the exception is raised.autorest/Samples/petstore/CSharp/SwaggerPetstoreExtensions.cs
Lines 214 to 217 in 75e583c
Exception is thrown at this line:
autorest/Samples/petstore/CSharp/SwaggerPetstore.cs
Line 897 in 75e583c
Releated info about
binary
format:OAI/OpenAPI-Specification#50 (comment)
OAI/OpenAPI-Specification#430
The text was updated successfully, but these errors were encountered: