Class: Jsapi::Meta::Schema::Reference

Inherits:
Model::Reference show all
Defined in:
lib/jsapi/meta/schema/reference.rb

Overview

Refers a reusable schema.

Instance Method Summary collapse

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

#existenceObject

: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_schemaObject

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