Class: Jsapi::Meta::Tag

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

Overview

Specifies a tag.

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 tag.



12
# File 'lib/jsapi/meta/tag.rb', line 12

attribute :description, String

#external_docsObject

:attr: external_docs The ExternalDocumentation object.



17
# File 'lib/jsapi/meta/tag.rb', line 17

attribute :external_docs, ExternalDocumentation

#kindObject

:attr: kind The category of the tag. Applies to OpenAPI 3.2 and higher.



22
# File 'lib/jsapi/meta/tag.rb', line 22

attribute :kind, String

#nameObject

:attr: name The name of the tag.



27
# File 'lib/jsapi/meta/tag.rb', line 27

attribute :name, String

#parentObject

:attr: parent The name of the parent tag. Applies to OpenAPI 3.2 and higher.



32
# File 'lib/jsapi/meta/tag.rb', line 32

attribute :parent, String

#summaryObject

:attr: summary The short summary of the tag. Applies to OpenAPI 3.2 and higher.



37
# File 'lib/jsapi/meta/tag.rb', line 37

attribute :summary, String

#to_openapi(version) ⇒ Object

Returns a hash representing the OpenAPI tag object.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/jsapi/meta/tag.rb', line 40

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

  with_openapi_extensions(
    if version >= OpenAPI::V3_2
      {
        name: name,
        summary: summary,
        description: description,
        externalDocs: external_docs&.to_openapi,
        parent: parent,
        kind: kind
      }
    else
      {
        name: name,
        description: description,
        externalDocs: external_docs&.to_openapi
      }
    end
  )
end