Class: Rswag::Specs::ExtendedSchema

Inherits:
JSON::Schema::Draft4
  • Object
show all
Defined in:
lib/rswag/specs/extended_schema.rb

Instance Method Summary collapse

Constructor Details

#initializeExtendedSchema

Returns a new instance of ExtendedSchema.



8
9
10
11
12
# File 'lib/rswag/specs/extended_schema.rb', line 8

def initialize
  super
  @uri = URI.parse('http://tempuri.org/rswag/specs/extended_schema')
  @names = ['http://tempuri.org/rswag/specs/extended_schema']
end

Instance Method Details

#validate(current_schema, data) ⇒ Object



14
15
16
17
18
# File 'lib/rswag/specs/extended_schema.rb', line 14

def validate(current_schema, data, *)
  return if data.nil? && (current_schema.schema['nullable'] == true || current_schema.schema['x-nullable'] == true)

  super
end