Skip to main content
Validity is published as two modules, under the group io.github.soleworks. They are released together, always at the same version, so a project that uses both never mixes versions.

validity-core

The DSL, the four entries and every constraint but the phone ones. Depends on the Kotlin standard library and kotlinx.coroutines.

validity-phone

phone, mobilePhone, countryCode and areaCode, and their messages. Depends on validity-core and Google’s libphonenumber.

What each package holds

Why phone numbers are apart

libphonenumber is large and holds the numbering plans of every country. Keeping it out of validity-core means a project that never validates a phone number does not ship it. A module adds its messages to the configuration without the core knowing it, through MessagesKey, the same way your own constraints can.

Nothing hidden

No module uses annotations, code generation or kotlin-reflect. The rules are plain Kotlin calls, compiled with your code, so what runs is what you read.

The public API

The public API of each module is kept in a dump, checked on every change, so nothing public changes by accident. Validity follows Semantic Versioning: while the version is 0.x, a breaking change raises the minor version, and the changelog says what to change.