- Fix no
validations
error onvalidatable?
(now returnsfalse
) - Update
bundler
to2.x
- Change default expected type for
attribute
to Object - Remove default
actionpack
calls for.register
- Add integration for registering with
actionpack
(rails) - Add integration for registering with
http
(http.rb) - Fix stack overflow for cyclic schema
- Fix an issue with
attribute(optional:, &block)
not passingoptional:
to the createdcollection
.
- Fix formatter reworked template when fields are not present
- Remove
require 'awesome_print'
in library code as it's marked as a development dependency onlvy
- Add requires in files with missing requires
- Fix merging optional attributes
- Change
#inspect
to look like a tree
- Change internal representation of key to symbol
- Change default type from
nil
toObject
, removing special behaviour for nil - Add
Rules
class to handle normalization of keys and handlingrules
(Scheme
,Attribute
, etc) - Add guard classes to handle guard behaviour (
OutputEmptyGuard
,OutputTypeGuard
andRulesExhaustedGuard
) - Add
optional:
keywords to most dsl (attribute
,collection
,any
,link
) - Add
Formatter
class to handle formatting of theConstructable#to_s
- Add behaviour to strip leading dot (
.
) or plus (+
) from+%<var>
ifvar
is nil, fixing weird media types - Add behaviour to remove format variable values if format variable is not present, fixing warnings
- Add
inspect
for most public classes - Add second argument for type or scheme to
any
dsl, mimickingcollection
- Add tests for most dsl, common permutations
- Rename
force
toexpected_type
- Remove
format_view
behaviour where it adds a dot (.
) if a view is present - Remove special iteration behaviour for
Links
(link
dsl), allowing them to be optional, or non-exhaustive - Raise error if
self.base_format
is not available at time ofDsl.media_type
call - Fix
expected_type
guard for arrays, nil, or arrays with nil.
- Use strings for
:_links
, matching the other validation keys
- Simplify
assert_media_type_format
by dumping views completely - Add test for
merge
- Add test for nested blocks in
validations
usingview
andversion
nesting - Add test for
validatable?
- Add block passing to
Scheme.new
- Add
merge
dsl to merge twoScheme
- Change validation to accept both symbolised and stringified input ánd validations
- Add automatic require for
media_types/scheme/any_of
- Change messages for
assert_media_types_registered
to be more informative and consistent
- Fix an issue with
Hash#compact
which was introduce in 2.4+. Now works with Ruby 2.3
- Fix an issue with
Registrar#versions
- Fix link in the gemspec to Github
- Fix an issue with
Constructable#valid?
andConstructable#validate!
Breaking changes to update public API and usage
- Remove
Base
class (useMediaTypes::Dsl
instead) - Remove a lot of configuration options as they are deemed unneeded
- Remove
active_support
dependency - Rename
ConstructableMimeType
toConstructable
- Moved global scheme types to
Scheme
as subtype - Add
MediaTypes::Dsl
- Add
validations
block to capture schemes - Add
registrations
block to capture register intent - Add
defaults
block to capture mime type defaults - Add
MediaTypes.register
class method to callMime::Type.register
- Add
Registerable
capture class - Add type / base setting for
Constructable
- Add versioned validations
- Add forced types of
collection
s - Add
attribute
with block - Add
EnumerationOfType
for schema typed arrays - Add
AnyOf
for scheme enum types - Add non-block calls for
Scheme
dsl - Add yard documentation to
/docs
👶 initial release