Sha256: 9c680c6e2cca14f250d0e1bf3daff067ded1c78327391c0d2bd5e67d4af9e984
Contents?: true
Size: 706 Bytes
Versions: 14
Compression:
Stored size: 706 Bytes
Contents
require "json-schema" class Swagalicious class ExtendedSchema < JSON::Schema::Draft4 def initialize super @attributes["type"] = ExtendedTypeAttribute @uri = URI.parse("http://tempuri.org/swagalicious/extended_schema") @names = ["http://tempuri.org/swagalicious/extended_schema"] end end class ExtendedTypeAttribute < JSON::Schema::TypeV4Attribute def self.validate(current_schema, data, fragments, processor, validator, options={}) return if data.nil? && (current_schema.schema["null"] == true || current_schema.schema["nullable"] == true) super end end JSON::Validator.register_validator(ExtendedSchema.new) end
Version data entries
14 entries across 14 versions & 1 rubygems