get no deprecation; add some docs

This commit is contained in:
Dante Piombino
2017-02-16 16:31:45 -05:00
parent cf9170101b
commit 233c5cc735
2 changed files with 27 additions and 4 deletions

View File

@@ -2,18 +2,16 @@ require 'json-schema'
module Rswag
module Specs
class ExtendedSchema < JSON::Schema::Validator
class ExtendedSchema < JSON::Schema::Draft4
def initialize
super
extend_schema_definition("http://json-schema.org/draft-04/schema#")
@attributes['type'] = ExtendedTypeAttribute
@uri = URI.parse('http://tempuri.org/rswag/specs/extended_schema')
@names = ['http://tempuri.org/rswag/specs/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['x-nullable'] == true
super