Skip to content

Releases: fastify/fluent-json-schema

v0.6.2

10 Mar 19:11
Compare
Choose a tag to compare

Bug fixes:

  • Fix for nested props after required is used #31
  • Fix null TS definition and null detection in isFluentSchema

v0.6.1

07 Feb 22:10
Compare
Choose a tag to compare

Fixes

  • #27 fix Typescript reserved word issue in the type definitions

v0.6.0

01 Feb 21:53
Compare
Choose a tag to compare

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')

v0.5.0

28 Dec 21:22
Compare
Choose a tag to compare

New Features

  • Add support for required in nested prop
const schema = FluentSchema()
  .prop('foo', FluentSchema().asString().required())

v0.4.0

22 Dec 16:06
Compare
Choose a tag to compare

New Features

  • Typescript support
  • Add contentMediaType and contentEncoding support
  • Native javascript regex can be passed to pattern method

Bug fixes

  • Remove extra ids in definition if generatedIds is disabled
  • Fix anyOf, allOf, oneOf implementation