Releases: fastify/fluent-json-schema
Releases · fastify/fluent-json-schema
v0.6.2
v0.6.1
v0.6.0
New Features
- New Syntax more compact
- Support for Mixed type
- Refactor Typescript types
- Complete internal refactor to manage in a better way all the types:
- BaseSchema (id, title, example, required, etc.)
- StringSchema (format, pattern, etc)
- ArraySchema (items, etc)
- ObjectSchema (properties, etc)
- NumberSchema (min, max, etc)
- IntegerSchema (min, max, etc)
- BooleanSchema
- NullSchema
- Coverage 99%
Fixes:
New syntax
const S = require('fluent-schema')
const schema = S.object()
.id('http://foo/user')
.title('My First Fluent JSON Schema')
.description('A simple user')
.prop(
'email',
S.string()
.format(S.FORMATS.EMAIL)
.required()
)
.prop(
'password',
S.string()
.minLength(8)
.required()
)
.prop('role', S.enum(['ADMIN', 'USER']).default('USER'))
.definition(
'address',
S.object()
.id('#address')
.prop('line1')
.required()
.prop('line2')
.prop('country')
.required()
.prop('city')
.required()
.prop('zipcode')
.required()
)
.prop('address')
.ref('#address')