Releases: ardatan/feTS
March 25, 2026
fets@0.8.6
Patch Changes
-
#3650
db80dbc
Thanks @copilot-swe-agent! - Allow optional request
bodies in OpenAPI spec by respecting TypeBoxType.OptionalmodifierPreviously, the OpenAPI plugin hardcoded
requestBody.required = truefor all JSON and formData
request bodies, making it impossible to declare optional bodies usingType.Optional<...>or
similar patterns from TypeBox.The plugin now checks for the TypeBox
OptionalKindsymbol on the schema and sets
requestBody.requiredaccordingly. Non-TypeBox schemas and non-optional schemas continue to
producerequired: true(preserving backward compatibility), while schemas wrapped with
Type.Optional(...)correctly producerequired: false.router.route({ path: '/example', method: 'POST', schemas: { request: { json: Type.Optional(Type.Object({ name: Type.String() })) } }, handler: () => Response.json({ ok: true }) }) // → requestBody.required === false in the generated OpenAPI spec
-
#3662
8c5d3e0
Thanks @copilot-swe-agent! - Fix "Type of property
circularly references itself" error with arrays of recursive objectsSchemas where a recursive type is referenced through an array property (e.g.
children: { type: 'array', items: { $ref: '#/components/schemas/Node' } }) previously triggered
TypeScript error TS2615 when used withcreateClientor theOASModel/OASOutput/
OASJSONResponseSchemahelpers.The root cause was in the
Circular<T>type helper, which only detected self-references via
direct property values (child: Node) but not through array items (children: Node[]). After
NormalizeOASresolves$refs it injects a$idfield onto resolved schemas, making array items
a subtype of the parent rather than the identical type. The existing equality-based check
therefore returnedfalsefor the array case, allowingjson-schema-to-tsto try to expand the
circular type and hit TS2615.A new
ArrayItemValue<T>helper extracts theitemsschema from an array-typed JSON schema. The
Circular<T>check now additionally tests whether any array-property's items extend the parent
schema, correctly identifying circular array references and disabling the problematic deserializer
expansion.Before (broken):
// Node.children is an array of Node — triggered TS2615 const client = createClient<NormalizeOAS<typeof oas>>({}) await client['/tree'].get() // Error: Type of property 'children' circularly references itself
After (fixed):
const client = createClient<NormalizeOAS<typeof oas>>({}) const res = await client['/tree'].get() if (res.ok) { const body = await res.json() body.children?.[0]?.children?.[0]?.number // correctly typed as number | undefined }
-
#3665
5fd3022
Thanks @copilot-swe-agent! - Fix "Type of property
circularly references itself" error for mutually-recursive schemas (e.g. Argo Workflows OpenAPI
spec)Large OpenAPI specs such as Argo Workflows contain mutually-recursive schema references (e.g.
Template → DAGTemplate → DAGTask → Template). These schemas caused TypeScript error TS2615 when
used withOASModel,OASOutput,OASJSONResponseSchema, orcreateClient.The root cause was in the
Circular<T>type helper, which detected only:- Direct self-references (
child: NodewhereNode.childresolves back to the sameNodetype) - Array self-references added in a previous fix (
children: Node[])
It did not detect indirect mutual recursion (Schema A → Schema B → Schema A), because the
recursive type checkCircular<PropertyValue<A>>eventually callsCircular<A>again, causing
TypeScript to hit its recursion limit and silently fail, leaving the deserializer enabled and
triggering TS2615 insidejson-schema-to-ts.The fix extends
Circular<T>to also returntruewhen any property of the schema is a
resolved$ref— identified by the presence of a$idfield thatNormalizeOASinjects.
Such schemas were resolved from$refentries in the original OpenAPI document and may
participate in complex circular reference chains. Disabling the deserializer expansion for these
schemas avoids the TS2615 error.Before (broken):
// Template → DAGTemplate → DAGTask → Template caused TS2615 type NormalizedArgo = NormalizeOAS<typeof argoWorkflowsOAS> type TemplateType = OASModel<NormalizedArgo, 'Template'> // Error: TS2615 const client = createClient<NormalizedArgo>({}) await client['/workflow'].get() // Error: TS2615
After (fixed):
type NormalizedArgo = NormalizeOAS<typeof argoWorkflowsOAS> type TemplateType = OASModel<NormalizedArgo, 'Template'> // Works! const client = createClient<NormalizedArgo>({}) const res = await client['/workflow'].get() // Works! if (res.ok) { const body = await res.json() body.dag?.tasks?.[0]?.name // correctly typed as string | undefined }
- Direct self-references (
-
#3652
4c0976b
Thanks @copilot-swe-agent! - Fix object types with
arraytype(e.g.["object", "null"]) being inferred asundefinedOpenAPI 3.1 schemas that declare a nullable object using an array type such as
"type": ["object", "null"]were incorrectly inferred asundefinedin the feTS client instead
of resolving to the correct union type (e.g.
{ url: string; name: string; size: number } | null).The root cause was in the
FixJSONSchematype pipeline:FixMissingTypeObjectunconditionally added& { type: 'object' }to any schema with
properties, even whentypewas already set. Fortype: ["object", "null"]this produced
{ type: ["object", "null"] } & { type: 'object' }→{ type: never }, causing
json-schema-to-tsto yieldundefined.FixMissingAdditionalPropertiesonly matchedtype: 'object'(string literal), so schemas with
array types never received the requiredadditionalProperties: falseinjection.
Both helpers have been updated to correctly handle array-style type declarations.
-
#3649
bce414f
Thanks @copilot-swe-agent! - Fix client sending HTTP
methods in lowercase (e.g.patchinstead ofPATCH). The client now normalizes all HTTP methods
to uppercase before sending the request. -
#3653
742c313
Thanks @copilot-swe-agent! - Fix required query
parameters becoming optional when mixed with header parameters in the client type generation.
Previously, when an endpoint had both query and header parameters, required query parameters were
incorrectly typed as optional. The fix correctly checks whether any parameter of the specific type
(query or header) is marked asrequired: trueinstead of using a tuple check across all
parameter types. -
#3651
3d17b72
Thanks @copilot-swe-agent! - fix: apply
encodeURIComponentto URL path parameters increateClientPreviously, path parameters were substituted into the URL as-is, which could result in malformed
URLs when the parameter values contained characters such as spaces, slashes, question marks, or
non-ASCII characters.For example, passing
{ id: 'hello world' }to/todo/{id}would produce/todo/hello world
instead of/todo/hello%20world.With this fix, all path parameter values are now passed through
encodeURIComponentbefore being
substituted into the URL, ensuring that the generated request URL is always valid and correctly
encoded. -
#3654
a313e10
Thanks @copilot-swe-agent! - Adduse()method for
router composition and mergingRouters can now be composed together using the
.use()method, allowing you to split routes
across multiple files and merge them into a parent router.// users-router.ts const usersRouter = createRouter().route({ path: '/users', method: 'GET', handler: () => Response.json({ users: [] }) }) // app.ts const app = createRouter() .use(usersRouter) // merge at existing paths .use('/api', anotherRouter) // merge under a prefix
The
.use()method supports:- Merging a sub-router at its existing paths
- Merging with a path pref...
March 05, 2025
fets@0.8.5
Patch Changes
- #2475
dc7abfe
Thanks @renovate! - dependencies updates:- Updated dependency
@whatwg-node/server@^0.10.0↗︎
(from^0.9.55, independencies)
- Updated dependency
November 15, 2024
fets@0.8.4
Patch Changes
- #2081
6eeda76
Thanks @renovate! - dependencies updates:- Updated dependency
@sinclair/typebox@^0.34.0↗︎
(from^0.33.0, independencies)
- Updated dependency
August 16, 2024
August 07, 2024
fets@0.8.2
Patch Changes
- #1791
0f49090
Thanks @renovate! - dependencies updates:- Updated dependency
@sinclair/typebox@^0.33.0↗︎
(from^0.32.0, independencies)
- Updated dependency
June 11, 2024
March 25, 2024
fets@0.8.0
Minor Changes
- #1313
4f9c219Thanks @colonel-sanders! - Support for multipart fields other than string or file
March 14, 2024
January 02, 2024
December 22, 2023
fets@0.7.0
Minor Changes
Patch Changes
-
#915
3be42d8Thanks @renovate! - dependencies updates:- Updated dependency
@sinclair/typebox@^0.32.0↗︎ (from^0.31.23, independencies)
- Updated dependency
-
#967
98d2323Thanks @renovate! - dependencies updates:- Updated dependency
json-schema-to-ts@^3.0.0↗︎ (from^2.9.1, independencies)
- Updated dependency
-
#977
5c993efThanks @renovate! - dependencies updates:- Updated dependency
@sinclair/typebox@^0.32.0↗︎ (from^0.31.23, independencies)
- Updated dependency