All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
-
Feature: Every endpoint method now accepts a third parameter called
next
. This gives express authors access to the express internals if they are usefulgetUsers: (req, res, next: NextFunction) => { // implementation }
-
Feature: Support a
skipResponseValidation
configuration so that users can disable response validation. Note that this will still keep the serialization layer. To enable this configuration, add the following option to yourgenerators.yml
:config: skipResponseValidation: true
-
Feature: Bump to v43 of IR which means that you will need
0.26.1
of the Fern CLI version. To bump your CLI version, please runfern upgrade
.If you specify custom response status codes, the underlying express implementation will send that back to the user.
-
Improvement: Support a
skipRequestValidation
configuration so that users can disable request validation if they want to. To do so, add the following option to yourgenerators.yml
config: skipRequestValidation: true
-
Improvement: Remove unnecessary
console.error
statements whenever the server implementation throws an error. The router will now only log the warnings whenever an unrecognized error is thrown like so:try { ... } catch (error) { if (error instanceof errors.AcmeError) { console.warn( `Endpoint 'post' unexpectedly threw ${error.constructor.name}.` + ` If this was intentional, please add ${error.constructor.name} to` + " the endpoint's errors list in your Fern Definition." ); await error.send(res); } else { res.status(500).json("Internal Server Error"); } next(error); }
-
Support V38 of the IR
-
Feature: Add
allowExtraFields
option to permit extra fields in the returned response.- name: fernapi/fern-typscript-express version: 0.11.0-rc0 ... config: allowExtraFields: true
- Support V37 of the IR.
- Feature: Add
retainOriginalCasing
option to preserve the naming convention expressed in the API. For example, the following Fern definition will generate a type like so:
types:
GetUsersRequest
properties:
group_id: string
Before
export interface GetUsersRequest {
groupId: string;
}
export interface GetUsersRequest = core.serialization.object({
groupId: core.serialization.string("group_id")
})
export namespace GetUsersRequest {
interface Raw {
group_id: string
}
}
After
export interface GetUsersRequest {
group_id: string;
}
export interface GetUsersRequest = core.serialization.object({
group_id: core.serialization.string()
})
export namespace GetUsersRequest {
interface Raw {
group_id: string
}
}
-
Fix: Compile started failing for express generators with the following error:
error TS2688: Cannot find type definition file for 'mime'. The file is in the program because: Entry point for implicit type library 'mime'
The root cause is because a breaking change was released in v4 of the mime library. This is now fixed because the generator resolves to v3 of the library as specified in this GitHub issue.
- Improvement: Enhance serde performance by reducing reliance on async behavior and lazy async dynamic imports.
- Internal: Shared generator notification and config parsing logic.
- Chore: Intialize this changelog