Class: Miniswag::ExtendedSchema
- Inherits:
-
JSON::Schema::Draft4
- Object
- JSON::Schema::Draft4
- Miniswag::ExtendedSchema
- Defined in:
- lib/miniswag/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.
7 8 9 10 11 |
# File 'lib/miniswag/extended_schema.rb', line 7 def initialize super @uri = URI.parse('http://tempuri.org/miniswag/extended_schema') @names = ['http://tempuri.org/miniswag/extended_schema'] end |
Instance Method Details
#validate(current_schema, data) ⇒ Object
13 14 15 16 17 |
# File 'lib/miniswag/extended_schema.rb', line 13 def validate(current_schema, data, *) return if data.nil? && (current_schema.schema['nullable'] == true || current_schema.schema['x-nullable'] == true) super end |