Class: Jsapi::Meta::Schema::Reference
- Inherits:
-
Model::Reference
- Object
- Model::Base
- Model::Reference
- Jsapi::Meta::Schema::Reference
- Defined in:
- lib/jsapi/meta/schema/reference.rb
Overview
Refers a reusable schema.
Instance Method Summary collapse
-
#existence ⇒ Object
:attr: existence Overrides the level of existence of the referred schema.
-
#to_json_schema ⇒ Object
Returns a hash representing the JSON Schema reference object.
Methods inherited from Model::Reference
component_type, #description, openapi_component_type, #ref, #reference?, #resolve, #resolve_lazily, #summary, #to_openapi
Methods inherited from Model::Base
#initialize, #inspect, #merge!, #reference?, #resolve
Methods included from Model::Attributes
#attributes_frozen?, #freeze_attributes, included
Constructor Details
This class inherits a constructor from Jsapi::Meta::Model::Base
Instance Method Details
#existence ⇒ Object
:attr: existence Overrides the level of existence of the referred schema.
11 |
# File 'lib/jsapi/meta/schema/reference.rb', line 11 attribute :existence, Existence, default: Existence::ALLOW_OMITTED |
#to_json_schema ⇒ Object
Returns a hash representing the JSON Schema reference object.
14 15 16 |
# File 'lib/jsapi/meta/schema/reference.rb', line 14 def to_json_schema { '$ref': "#/definitions/#{ref}" } end |