Class: Rswag::Specs::ExtendedSchema
- Inherits:
-
JSON::Schema::Draft4
- Object
- JSON::Schema::Draft4
- Rswag::Specs::ExtendedSchema
- Defined in:
- lib/rswag/specs/extended_schema.rb
Instance Method Summary collapse
-
#initialize ⇒ ExtendedSchema
constructor
A new instance of ExtendedSchema.
- #validate(current_schema, data) ⇒ Object
Constructor Details
#initialize ⇒ ExtendedSchema
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 |