Class: Jsapi::Meta::Link::Model

Inherits:
Base::Model show all
Includes:
OpenAPI::Extensions
Defined in:
lib/jsapi/meta/link/model.rb

Overview

Specifies a link object.

Constant Summary

Constants included from Base::Attributes

Base::Attributes::DEFAULT_ARRAY, Base::Attributes::DEFAULT_HASH

Instance Method Summary collapse

Methods included from OpenAPI::Extensions

#add_openapi_extension, #openapi_extensions, #openapi_extensions=

Methods inherited from Base::Model

#initialize, #inspect, #merge!, #reference?, #resolve

Methods included from Base::Attributes

#attribute, #attribute_names

Constructor Details

This class inherits a constructor from Jsapi::Meta::Base::Model

Instance Method Details

#descriptionObject

:attr: description The description of the link.



13
# File 'lib/jsapi/meta/link/model.rb', line 13

attribute :description, String

#operation_idObject

:attr: operation_id The operation ID.



18
# File 'lib/jsapi/meta/link/model.rb', line 18

attribute :operation_id, String

#parametersObject

:attr: parameters The parameters to be passed.



23
# File 'lib/jsapi/meta/link/model.rb', line 23

attribute :parameters, { String => Object }

#request_bodyObject

:attr: request_body The request body to be passed.



28
# File 'lib/jsapi/meta/link/model.rb', line 28

attribute :request_body

#serverObject

:attr: server The Server object.



33
# File 'lib/jsapi/meta/link/model.rb', line 33

attribute :server, Server

#to_openapiObject

Returns a hash representing the OpenAPI link object.



36
37
38
39
40
41
42
43
44
# File 'lib/jsapi/meta/link/model.rb', line 36

def to_openapi(*)
  with_openapi_extensions(
    operationId: operation_id,
    parameters: parameters.presence,
    requestBody: request_body,
    description: description,
    server: server&.to_openapi
  )
end