Skip to content

Commit

Permalink
fix(typescript): Don't double wrap a blob if a user uploads a blob to…
Browse files Browse the repository at this point in the history
… a multi-part form. (#5776)

 fix(typescript): Don't double wrap a blob if a user uploads a blob to a multi-part form.
  • Loading branch information
Swimburger authored Jan 29, 2025
1 parent 53ed96d commit ebb97be
Show file tree
Hide file tree
Showing 21 changed files with 64 additions and 33 deletions.
5 changes: 5 additions & 0 deletions generators/typescript/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.48.5] - 2025-01-28

- Fix: Don't double wrap a blob if a user uploads a blob to a multi-part form.
Otherwise file's content-type is lost in Deno.

## [0.48.4] - 2025-01-21

- Fix: When custom config `useBigInt` is `true`, generate examples and snippets with `BigInt("123")`.
Expand Down
2 changes: 1 addition & 1 deletion generators/typescript/sdk/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.48.4
0.48.5
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ export class WebFormData implements CrossPlatformFormData {
if (fileName == null && isNamedValue(value)) {
fileName = value.name;
}
if (value instanceof Blob) {
this.fd?.append(key, value, fileName);
return;
}
this.fd?.append(key, new Blob([value]), fileName);
}

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`help > no arguments 1`] = `
"fern-dev
"(node:20167) [DEP0040] DeprecationWarning: The \`punycode\` module is deprecated. Please use a userland alternative instead.
(Use \`node --trace-deprecation ...\` to show where the warning was created)
fern-dev
Commands:
fern-dev init Initialize a Fern API
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ service:
max: 100
response:
docs: A paged array of pets
status-code: 200
type: root.Pets
source:
openapi: openapi/openapi.yml
Expand All @@ -93,6 +94,7 @@ service:
type: string
response:
docs: Expected response to a valid request
status-code: 200
type: root.Pet
source:
openapi: openapi/openapi.yml
Expand Down Expand Up @@ -178,6 +180,7 @@ service:
max: 100
response:
docs: A paged array of pets
status-code: 200
type: root.Pets
source:
openapi: openapi/openapi.yml
Expand All @@ -200,6 +203,7 @@ service:
type: string
response:
docs: Expected response to a valid request
status-code: 200
type: root.Pet
source:
openapi: openapi/openapi.yml
Expand Down Expand Up @@ -316,6 +320,7 @@ service:
max: 100
response:
docs: A paged array of pets
status-code: 200
type: neopetsRoot.Pets
source:
openapi: openapi/petstore/openapi.yml
Expand All @@ -340,6 +345,7 @@ service:
type: string
response:
docs: Expected response to a valid request
status-code: 200
type: neopetsRoot.Pet
source:
openapi: openapi/petstore/openapi.yml
Expand Down Expand Up @@ -979,6 +985,7 @@ service:
content-type: application/json
response:
docs: Booking successful
status-code: 201
type: CreateBookingResponse
source:
openapi: openapi/trains/openapi.yml
Expand Down Expand Up @@ -1036,6 +1043,7 @@ service:
type: string
response:
docs: The booking details
status-code: 200
type: GetBookingResponse
source:
openapi: openapi/trains/openapi.yml
Expand Down Expand Up @@ -1071,6 +1079,7 @@ service:
path: /bookings
response:
docs: A list of bookings
status-code: 200
type: GetBookingsResponse
source:
openapi: openapi/trains/openapi.yml
Expand Down Expand Up @@ -1275,6 +1284,7 @@ service:
content-type: application/json
response:
docs: Payment successful
status-code: 200
type: CreateBookingPaymentResponse
source:
openapi: openapi/trains/openapi.yml
Expand Down Expand Up @@ -1348,6 +1358,7 @@ service:
path: /stations
response:
docs: A list of train stations
status-code: 200
type: GetStationsResponse
source:
openapi: openapi/trains/openapi.yml
Expand Down Expand Up @@ -1500,6 +1511,7 @@ service:
format: uuid
response:
docs: A list of available train trips
status-code: 200
type: GetTripsResponse
source:
openapi: openapi/trains/openapi.yml
Expand Down Expand Up @@ -1992,6 +2004,7 @@ service:
name: ChatRequest
response:
docs: OK
status-code: 200
type: list<string>
source:
openapi: openapi/cohere.yaml
Expand Down Expand Up @@ -2315,6 +2328,7 @@ service:
name: V2ChatRequest
response:
docs: OK
status-code: 200
type: list<string>
source:
openapi: openapi/cohere-v2.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ service:
max: 100
response:
docs: A paged array of pets
status-code: 200
type: root.Pets
source:
openapi: openapi/openapi.yml
Expand All @@ -56,6 +57,7 @@ service:
type: string
response:
docs: Expected response to a valid request
status-code: 200
type: root.Pet
source:
openapi: openapi/openapi.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ service:
name: ChatRequest
response:
docs: OK
status-code: 200
type: list<string>
source:
openapi: openapi/cohere.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ service:
name: V2ChatRequest
response:
docs: OK
status-code: 200
type: list<string>
source:
openapi: openapi/cohere-v2.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ service:
max: 100
response:
docs: A paged array of pets
status-code: 200
type: neopetsRoot.Pets
source:
openapi: openapi/petstore/openapi.yml
Expand All @@ -60,6 +61,7 @@ service:
type: string
response:
docs: Expected response to a valid request
status-code: 200
type: neopetsRoot.Pet
source:
openapi: openapi/petstore/openapi.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ service:
content-type: application/json
response:
docs: Booking successful
status-code: 201
type: CreateBookingResponse
source:
openapi: openapi/trains/openapi.yml
Expand Down Expand Up @@ -126,6 +127,7 @@ service:
type: string
response:
docs: The booking details
status-code: 200
type: GetBookingResponse
source:
openapi: openapi/trains/openapi.yml
Expand Down Expand Up @@ -161,6 +163,7 @@ service:
path: /bookings
response:
docs: A list of bookings
status-code: 200
type: GetBookingsResponse
source:
openapi: openapi/trains/openapi.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ service:
content-type: application/json
response:
docs: Payment successful
status-code: 200
type: CreateBookingPaymentResponse
source:
openapi: openapi/trains/openapi.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ service:
path: /stations
response:
docs: A list of train stations
status-code: 200
type: GetStationsResponse
source:
openapi: openapi/trains/openapi.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ service:
format: uuid
response:
docs: A list of available train trips
status-code: 200
type: GetTripsResponse
source:
openapi: openapi/trains/openapi.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ service:
max: 100
response:
docs: A paged array of pets
status-code: 200
type: root.Pets
source:
openapi: openapi/openapi.yml
Expand All @@ -56,6 +57,7 @@ service:
type: string
response:
docs: Expected response to a valid request
status-code: 200
type: root.Pet
source:
openapi: openapi/openapi.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,8 @@
"type": "unknown"
}
}
}
},
"statusCode": 200
},
"errorsV2": [],
"examples": [
Expand Down Expand Up @@ -804,6 +805,7 @@
"value": "type_:UploadResponse"
}
},
"statusCode": 200,
"description": "OK"
},
"errorsV2": [],
Expand Down Expand Up @@ -946,6 +948,7 @@
"value": "type_:DeleteResponse"
}
},
"statusCode": 200,
"description": "OK"
},
"errorsV2": [],
Expand Down Expand Up @@ -1027,6 +1030,7 @@
"value": "type_:DescribeResponse"
}
},
"statusCode": 200,
"description": "OK"
},
"errorsV2": [],
Expand Down Expand Up @@ -1129,6 +1133,7 @@
"value": "type_:FetchResponse"
}
},
"statusCode": 200,
"description": "OK"
},
"errorsV2": [],
Expand Down Expand Up @@ -1280,6 +1285,7 @@
"value": "type_:ListResponse"
}
},
"statusCode": 200,
"description": "OK"
},
"errorsV2": [],
Expand Down Expand Up @@ -1477,6 +1483,7 @@
"value": "type_:QueryResponse"
}
},
"statusCode": 200,
"description": "OK"
},
"errorsV2": [],
Expand Down Expand Up @@ -1678,6 +1685,7 @@
"value": "type_:UpdateResponse"
}
},
"statusCode": 200,
"description": "OK"
},
"errorsV2": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@
"value": "type_:CreateResponse"
}
},
"statusCode": 200,
"description": "OK"
},
"errorsV2": [],
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ebb97be

Please sign in to comment.