Changelog for versions >2.0.3 is published in https://github.com/epiphone/class-validator-jsonschema/releases.
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.
- Handle undefined
typeMeta.reflectedType
in Map type resolution #45
- Handling for Map fields #35
- Fix metadata object mutation breaking validation in routing-controllers #36
- Same as v2.0.0-rc1
-
Bump
class-validator
peer dependency to^0.12.0
- meaning we're no longer compatible with pre-0.12 versions ofclass-validator
! -
validationMetadatasToSchemas
no longer takes avalidationMetadatas
object as first argument. Instead the library now automatically grabsvalidationMetadatas
fromgetMetadataStorage()
under the hood.This simplifies library usage from
const metadatas = (getFromContainer(MetadataStorage) as any).validationMetadatas const schemas = validationMetadatasToSchemas(metadatas)
into plain
const schemas = validationMetadatasToSchemas()
You can still choose to override the default metadata storage using the optional options argument:
const schemas = validationMetadatasToSchemas({ classValidatorMetadataStorage: myCustomMetadataStorage })
- The default enum converter uses
Object.values
instead ofObject.key
to support named values such asenum SomeEnum { Key = 'value' }
(thanks @DimalT at #23)
- Moved
class-transformer
andclass-validator
to peer dependencies #11 - Updated dependencies
- Update dependencies to fix mismatch with
class-validator
andclass-tranformer
#11
- Support
class-transfomer
's@Type
decorator for explicitly defining type of nested properties wrapped in a generic (e.g.@ValidateNested({ each: true }) users: UserClass[]
) #7
- Update
openapi3-ts
dependency to fix incorrectSchemaObject.additionalProperties
type #4 - Omit the
required
property in case of no required properties instead of an empty list:required: []
#5
- Add missing handling for inherited validation decorators #3
- @scboffspring fixed schema properties being mutated by
_.merge
#1
- Additional class/property schema keywords via the
@JSONSchema
decorator