CHANGELOG.md in dry-struct-0.6.0 vs CHANGELOG.md in dry-struct-0.7.0
- old
+ new
@@ -1,9 +1,38 @@
+# 0.7.0 2019-03-22
+
+## Changed
+
+* [BREAKING] `Struct.input` was renamed `Struct.schema`, hence `Struct.schema` returns an instance of `Dry::Types::Hash::Schema` rather than a `Hash`. Schemas are also implementing `Enumerable` but they iterate over key types.
+ New API:
+ ```ruby
+ User.schema.each do |key|
+ puts "Key name: #{ key.name }"
+ puts "Key type: #{ key.type }"
+ end
+ ```
+ To get a type by its name use `.key`:
+ ```ruby
+ User.schema.key(:id) # => #<Dry::Types::Hash::Key ...>
+ ```
+* [BREAKING] `transform_types` now passes one argument to the block, an instance of the `Key` type. Combined with the new API from dry-types it simplifies declaring omittable keys:
+ ```ruby
+ class StructWithOptionalKeys < Dry::Struct
+ transform_types { |key| key.required(false) }
+ # or simply
+ transform_types(&:omittable)
+ end
+ ```
+* `Dry::Stuct#new` is now more efficient for partial updates (flash-gordon)
+* Ruby 2.3 is EOL and not officially supported. It may work but we don't test it.
+
+[Compare v0.6.0...v0.7.0](https://github.com/dry-rb/dry-struct/compare/v0.6.0...v0.7.0)
+
# v0.6.0 2018-10-24
-## BREAKING CHANGES
+## Changed
-* `Struct.attribute?` in the old sense is deprecated, use `has_attribute?` as a replacement
+* [BREAKING] `Struct.attribute?` in the old sense is deprecated, use `has_attribute?` as a replacement
## Added
* `Struct.attribute?` is an easy way to define omittable attributes (flash-gordon):