Module: Tamara::JsonSchemas::Types::Date
- Defined in:
- lib/tamara/json_schemas/types/date.rb
Class Method Summary collapse
Class Method Details
.schema(allows_null: false, default: nil) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/tamara/json_schemas/types/date.rb', line 5 def self.schema(allows_null: false, default: nil) { "$schema": "http://json-schema.org/draft-06/schema", type: ["string", (allows_null ? "null" : nil)].compact, pattern: "^\\d{2}-\\d{2}-\\d{4}$", default: default, maxLength: 10 }.compact end |