Repository navigation
Compatibility
Upgrade from 1.10.x. Literal JSON strings are sent unchanged.
- Requires nice_hash 1.21 and string_pattern 2.5 (
nice_hash ~> 1.21). Ruby 3.0 or newer. generate(seed:)andgenerate_n(seed:)no longer repeat the strings from nice_hash 1.19.:uuid,:ibanand:luhnare not repeatable fromseed:.StringPattern.block_listmatches literals. SetStringPattern.block_list_regexp = truewhen the list holds regular expressions.- A
Regexppattern must match the whole string. - A one-element pattern array such as
[:"3:L"]generates 1 to 5 strings, including in connection headers (still generated once, when the client is created). - Pattern symbols and shorthands in a request body or request header (
:"10-20:L",:"a|b",:uuid,:email,:iban,:luhn,[:iban, "DE"],[:luhn, 15],Range,Regexp,DateTime,Boolean) are expanded before the request is sent. Previously:uuidwas sent as the text"uuid". Strings such as"10:N"or"a|b"are still sent as written. validate_responsetreats string keys the same as symbol keys, so a match that used to fail on key type can now beok: true. An expected pattern can also beok: truewhen the response value fits it.
Added
- Request
dataand per-request headers expand nice_hash pattern symbols and shorthands on each request. NiceHttp.validate_responseaccepts string or symbol keys and checks pattern fields withNiceHash.validate.explain: trueadds:explain(valid,errors,message,index) when a pattern fails.
Fixed
- Logging a response with no
content-typeno longer raises, so cookie handling after the log still runs. - Reconnecting after a dropped connection on POST, PUT, PATCH, DELETE and HEAD keeps the response body.