Skip to content

v0.6.0

Choose a tag to compare

@github-actions github-actions released this 06 Oct 14:41
· 21 commits to main since this release
181c39e

Minor Changes

  • #52 5fe0ef7 Thanks @Newbie012! - Read @nestjs/swagger decorators faithfully and generate schemas faster.

    • Decorator arguments are evaluated statically (constants, enum members, concatenation, template literals, Object.values, array methods); unreadable values are reported.
    • applyDecorators() wrappers are followed; the new decorators option describes wrappers that cannot be followed.
    • @ApiResponse and its shortcuts, @ApiBody, @ApiQuery/@ApiParam/@ApiHeader(s), @ApiExtension, @ApiExtraModels, @ApiProperty precedence and mapped types now match @nestjs/swagger.
    • Path arrays, @Version() and @All() are documented. New options: versioning, transformPath, include, deepScanRoutes and enums.
    • Schemas are generated in one TypeScript program per run, and a type the generator crashes on is recovered instead of dropped.

    Output changes for existing users: operations gain the responses, parameters and metadata their decorators declare, and examples follow the OpenAPI version.

  • #53 ef0d9be Thanks @Newbie012! - One schema per declaration, and spec-valid component names.

    Output changes for existing users:

    • Different declarations sharing a name (two files each declaring an AddressDto) no longer share one schema. By default each is written in place where it is used, with a warning; the new schemaNameCollision option can name them after their files ('rename'), use a naming function, or fail ('error').
    • Generic instantiations get valid component names: Page<User> becomes Page_User. Set schemas.genericNames: 'raw' to keep the TypeScript names.
    • MissingGenericSchemaTempFileWriteError and MissingGenericSchemaTempFileCleanupError are no longer exported.