Class: Jsapi::Meta::Link::Base

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

Overview

Specifies a link.

Instance Method Summary collapse

Methods included from OpenAPI::Extensions

included

Methods inherited from Jsapi::Model::Base

#==, #errors, #initialize, #inspect, model_name, #respond_to_missing?

Constructor Details

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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Jsapi::Model::Base

Instance Method Details

#descriptionObject

:attr: description The description of the link.



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

attribute :description, String

#operation_idObject

:attr: operation_id The operation ID.



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

attribute :operation_id, String

#parametersObject

:attr: parameters The parameters to be passed.



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

attribute :parameters, { String => Object }

#request_bodyObject

:attr: request_body The request body to be passed.



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

attribute :request_body

#serverObject

:attr: server The Server object.



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

attribute :server, Server

#to_openapi(version) ⇒ Object

Returns a hash representing the OpenAPI link object.



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

def to_openapi(version, *)
  version = OpenAPI::Version.from(version)

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