Class: RSpec::Swag::ExtendedSchema
- Inherits:
-
JSON::Schema::Draft4
- Object
- JSON::Schema::Draft4
- RSpec::Swag::ExtendedSchema
- Defined in:
- lib/rspec/swag/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/rspec/swag/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 19 20 |
# File 'lib/rspec/swag/extended_schema.rb', line 14 def validate(current_schema, data, *) if data.nil? && (current_schema.schema["nullable"] == true || current_schema.schema["x-nullable"] == true) return end super end |