Module: Tamara::JsonSchemas::ShippingInfo

Defined in:
lib/tamara/json_schemas/shipping_info.rb

Class Method Summary collapse

Class Method Details

.schema(allows_null: false) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/tamara/json_schemas/shipping_info.rb', line 4

def self.schema(allows_null: false)
  {
    "$schema": "http://json-schema.org/draft-06/schema",
    type: ["object", (allows_null ? "null" : nil)].compact,
    properties: {
      shipped_at: Types::String.schema,
      shipping_company: Types::String.schema
    },
    required: %w[shipped_at shipping_company]
  }
end