Open Euler-KB opened 5 years ago
This line content_ = JSON.stringify(body);
shouldn't be
Can you post a sample swagger spec?
"/api/farmers/update/profile/photo/{id}":{"put":{"tags":["Farmers"],"operationId":"Farmers_UpdateProfilePhoto","consumes":["application/octet-stream"],"produces":["application/json","text/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"integer","format":"int32"},{"name":"body","in":"body","description":"The content of the file","required":true,"type":"binary","format":"binary"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/MediaModel"}},"201":{"description":"Created","schema":{"$ref":"#/definitions/MediaModel"}},"404":{"description":"Invalid request response","schema":{"$ref":"#/definitions/BasicResponse"}},"500":{"description":"Internal server error","schema":{"$ref":"#/definitions/BasicResponse"}}}}}
I'm generating a Typescript client for an endpoint with binary type and format.
Unfortunately the body is being serialized to json...
` updateProfilePhoto(id: number, body: any): Promise {
let url = this.baseUrl + "/api/farmers/update/profile/photo/{id}";
if (id === undefined || id === null)
throw new Error("The parameter 'id' must be defined.");
url = url.replace("{id}", encodeURIComponent("" + id));
url = url_.replace(/[?&]$/, "");