-
Remove support for ruby < 2.6
-
Remove support for .Fixnum and .Bignum, .Integer is now used everywhere. To ease the transition, Fixum and Bignum still exist in the finitio/data stdlib schema, but will be removed in 0.13.x
-
The proxy resolution is fixed and clarified. When compiling a system, all proxies are actually replaced by their actual Type instance. Only recursive types still keep ProxyType instances (as sentinels) ; they are bound to their target type and delete dress and include? to them.
Given that ProxyType is a sentinel on recursive types, calls to generate_data and to_json_schema are not delegated to the target type, to avoid infinite recursions.
-
Generated names of instantiated high order types are better (e.g. Collection).
- Fix json_schema generation on unresolved ProxyTypes. We use "object" by default, waiting for a better support for recursive types.
- Fix json_schema generation on builtin_type NilClass. "null" is not a valid value, we now use "string" instead.
- Fix github actions and extend test grid.
- Fix json schema generation of Boolean and union types with a |Nil
- Add support for dashses in attribute names (tuple & relation types).
-
Upgrade all dependencies.
-
Ruby < 2.3 is no longer supported.
-
Fix code and build under Ruby 3.0.
- Fixes a bug where proxy types are not properly resolved when used
in a heading extra, e.g.
{ ...: Proxy }
- Add Type#to_json_schema that converts Finitio types to JSON schema representations. This first implementation skips all constraints on sub types, though. You need to explicitly require 'finitio/json_schema' to use it.
-
Add
Type#unconstrained
that returns a super type with all user specific constraints removed on sub types, recursively on all non scalar types. -
Add high-order types, such as
Collection<T> = [T]
-
Add support for random data generation through
Finitio::Generation
. Pleaserequire 'finitio/generation'
to use it.
-
Implement (basic) @import feature, working with relative paths and a standard library. The standard library systems are memoized to avoid unnecessary parsing and compilation.
-
System#check_and_warn
allows discovering warnings, infos and errors in system definitions, such as duplicate type definitions and import overrides. -
WARN: Finitio::DEFAULT_SYSTEM is deprecated. Use @import finitio/data instead.
- Fix support for typed extra attributes, a KeyError was raised when keys were Symbols and not Strings.
- Add support for typed extra attributes, e.g. { ...: Integer }
- Disable memoization in parser because it leads to terrible performance issues on some schemas.
- Avoid alternatives on high-level rules (Union, SubType) to prevent many fallbacks that kill performance without memoization enabled.
- Enabled memoization in parser to avoid very long parsing time on complex schemas.
-
Breaking changes on public API
-
Finitio.parse now returns the parsing tree, no longer the compiled system, use Finitio.system instead.
-
Dress error messages have been changed from
Invalid value xxx for Type
to a more friendlyInvalid Type xxx
. The rationale is that end-users might be exposed to those messages in practice. The new messages seem less cryptic.
-
-
Major enhancements
-
Types no longer have to declared before being used. In order words, the following will work fine even if Bigint references Posint that is declared afterwards:
``` Bigint = Posint( i | i >= 255 ) Posint = Integer( i | i >= 0 ) { length: Bigint } ```
-
Added support for recursive types, e.g.,
``` Tree = { label: String, children: [Tree] } ```
-
Added support for MultiTuple and MultiRelation types, aka "optional vs. required attributes". In the following system,
Person
is a multi tuple whilePersons
is a multi relation; the date of birth is optional in both cases:``` Person = { name : String, dob :? Date } Persons = {{ name : String, dob :? Date }} ```
-
Added basic support for namespacing, through dots being now allowed in type names. More namespacing support will be added later.
``` This.Is.A.NameSpaced.Type = .Integer( i | i >= 0 ) { length: This.Is.A.NameSpaced.Type } ```
-
Attribute names can now start with an underscore, e.g. '_links'
-
Error now have an
root_cause
helper. -
Dress errors resulting from Union and AdType now set a cause to the first error encountered during the various attempts to dress.
-
-
Breaking changes on undocumented APIs
- Removed factory methods from the Finitio module itself. Use a System instance instead.
- Removed Finitio::DataType
-
Other changes & Bug fixes
- Make Finitio compatible with both Citrus 2.4.x and Citrus 3.x
- Fixed parsing of constraint expressions having inner parentheses
- Fixed access to the default system that lead to 'Unknown system Finitio/default (Finitio::Error)'
- Finitio(-rb) is born from the sources of Q(rb) 0.3.0
- Finitio.parse now recognizes Path-like objects (responding to :to_path), allowing to parse files directly (through Pathname, Path, etc.).
- Added AnyType abstraction, aka '.'
- Added support for external contracts in ADTs
- Added support for extracting an Abstract Syntax Tree from parsing result
- Allows camelCasing in constraint names
- Fix dependencies in gemspec (judofyr)
-
Enhancements
- Birthday!