Skip to content

Releases: konform-kt/konform

0.4.0: Kotlin 1.6, nested onEach

01 Jun 15:31
Compare
Choose a tag to compare
  • Upgrade to Kotlin 1.6 (backwards compatible with versions 1.4 and 1.5) #41
  • onEach can be used inside of ifPresent when used with nullable collection types #34 h/t @wtomi
  • Use DSL markers to prevent scope leak #39 h/t @cies

0.3.0: Kotlin 1.4 + JS IR Backend

28 Apr 21:48
Compare
Choose a tag to compare
  • Upgrade to Kotlin 1.4
  • Enable new JS IR Backend (Thanks to @jillesvangurp)
  • Publish directly to MavenCentral due to sunset of Bintray

Subset of JSON Schema Validations

09 Mar 23:26
Compare
Choose a tag to compare
Pre-release

Konform now supports this list of validations from the JSON Schema spec

For Any instance

  • type: Check the type of the value (subtype of the declared type)
  • enum: Value must be one of the specified values, can also validate Strings based on Kotlin enum classes
  • const: Value must be equal to the specified value

For Numbers

  • multipleOf: Value must be a multiple of the given value
  • maximum: Inclusive upper bound on Number
  • exclusiveMaximum: Exclusive upper bound on Number
  • minimum: Inclusive lower bound on Number
  • exclusiveMinimum: Exclusive lower bound on Number

For Strings

  • minLength: Check minimum length of String
  • maxLength: Check maximum length of String
  • pattern: Validate using a regex pattern

For Arrays and Iterables

  • minSize: Array must contain a minimum number of items
  • maxSize: Array must not contain more than a maximum number of items
  • uniqueItems: All items in the Array must be unique

For Maps

  • minSize: Map must contain a minimum number of key value pairs
  • maxSize: Map must not contain more than a maximum number of key value pairs

Collection support

09 Mar 13:32
Compare
Choose a tag to compare
Collection support Pre-release
Pre-release

This release supports validation of collections:

  • Array
  • Iterable (List, ...)
  • Map

Next steps:

  • v0.1.0 Library of default constraints similar to JSON Schema
  • v0.2.0 i18n and l10n support for hints

Proof of concept

09 Mar 00:05
Compare
Choose a tag to compare
Proof of concept Pre-release
Pre-release

Initial release in pretty much proof of concept state.

What's working:

  • Type-safe builder
    • Works with properties on data classes
    • Recursively validate nested data classes
    • Validate nullable properties
  • Simple Hint/Error string interpolation with values from constraints

Next steps:

  • v0.0.2 Validation of collection type properties
  • v0.1.0 Library of default constraints similar to JSON Schema
  • v0.2.0 i18n and l10n support for hints