Skip to content

Commit 3ab85ad

Browse files
committed
Document custom formats
This behavior has been around but undocumented for a while. I'm adding this now because it's similar to custom content encodings and media types. Related: #137
1 parent febaf26 commit 3ab85ad

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,15 @@ JSONSchemer.schema(
180180
# default: true
181181
format: true,
182182

183+
# custom formats
184+
formats: {
185+
'int32' => proc do |instance, _format|
186+
instance.is_a?(Integer) && instance.bit_length <= 32
187+
end,
188+
# disable specific format
189+
'email' => false
190+
},
191+
183192
# custom content encodings
184193
# only `base64` is available by default
185194
content_encodings: {

0 commit comments

Comments
 (0)