Skip to content

Releases: laurence79/express-typescript-codegen

0.37.0

01 May 13:46
bef6089

Choose a tag to compare

Features

  • New mock-server template. Generates a leaner Express output for use as a typed mock API in integration tests.

    express-typescript-codegen generate spec.yaml --template mock-server

    Same public API as the express template (addHandlers(app, handlers), Handlers map, per-op ${Op}Handler type), so swapping is a one-line change in package.json. The differences:

    • No request validation: drops express-json-validator-middleware, inlined JSON schemas, and the validation error handler. Bad request bodies hit your handler logic, not a 400 wall — appropriate for test mocks where you don't want validation hiding app bugs.
    • No ${Op}Request collision: the Request<...> / Response<...> wrappers are inlined inside ${Op}Handler rather than exported as separate aliases, so user schemas titled ${Op}Request no longer clash with handler types.

    Supports both OpenAPI v3 and Swagger v2. Output is roughly 35% smaller than the express template on the same spec.

    The existing express template is unchanged.

0.36.0

27 Apr 13:37

Choose a tag to compare

Features

  • Runtime const arrays for named enums. Named enum schemas (those with a title) now also emit an as const array of the values, with the type derived from the array. Inline enums are unchanged.

    Generated output:

    export const EnabledOrganizations = ['all', 'none', 'selected'] as const;
    export type EnabledOrganizations = (typeof EnabledOrganizations)[number];

    Consumers can iterate enum values at runtime, build maps, or validate input without redefining the values. import type { ... } continues to erase the const at runtime; bundlers tree-shake unused exports.

0.35.3

23 Apr 15:00

Choose a tag to compare

What's Changed

  • fix: resolve cross-file PathItemObject $ref entries

PathItem-level $refs (e.g. /things/{thingId}: { $ref: './paths/things.yaml#/getThing' }) were falling through the generic component-inlining branch and getting stashed under #/components/schemas/<title> while the path entry retained a local $ref. Because methodsOfPathItemObject skips $ref, the referenced operations were silently dropped from generated output. In some configurations the path key could also be URL-encoded when building an internal JSON pointer, surfacing Invalid reference token: /things/%7BthingId%7D.

PathItem-position $refs are now inlined in place, preserving the original path key verbatim.

Full Changelog: 0.35.2...0.35.3

0.35.2

02 Apr 16:52
43c5395

Choose a tag to compare

What's Changed

  • fix: prevent OOM when loading multi-file OpenAPI specs by @laurence79 in #5

Full Changelog: 0.35.1...0.35.2

0.35.1

06 Nov 12:50

Choose a tag to compare

fix: Default fetch is unbound

0.35.0

11 Oct 17:55

Choose a tag to compare

Full Changelog: 0.34.0...0.35.0

0.34.0

11 Oct 14:47

Choose a tag to compare

Full Changelog: 0.33.0...0.34.0

0.33.0

11 Oct 10:28

Choose a tag to compare

Full Changelog: 0.32.0...0.33.0

0.32.0

09 Oct 17:34

Choose a tag to compare

Full Changelog: 0.31.0...0.32.0

0.31.0

09 Oct 11:57

Choose a tag to compare

Full Changelog: 0.30.0...0.31.0