Class: SpecForge::Documentation::OpenAPI::V30::Example
- Inherits:
-
Object
- Object
- SpecForge::Documentation::OpenAPI::V30::Example
- Defined in:
- lib/spec_forge/documentation/openapi/v3_0/example.rb
Overview
Represents an OpenAPI 3.0 Example object
Creates example objects for request/response documentation with optional summary, description, and external reference support.
Instance Method Summary collapse
-
#initialize(summary: nil, description: nil, value: nil, external_value: nil) ⇒ Example
constructor
Creates a new OpenAPI example object.
-
#to_h ⇒ Hash
Converts the example to an OpenAPI-compliant hash.
Constructor Details
#initialize(summary: nil, description: nil, value: nil, external_value: nil) ⇒ Example
Creates a new OpenAPI example object
26 27 28 |
# File 'lib/spec_forge/documentation/openapi/v3_0/example.rb', line 26 def initialize(summary: nil, description: nil, value: nil, external_value: nil) super end |
Instance Method Details
#to_h ⇒ Hash
Converts the example to an OpenAPI-compliant hash
35 36 37 38 39 |
# File 'lib/spec_forge/documentation/openapi/v3_0/example.rb', line 35 def to_h super .rename_key_unordered!(:external_value, :externalValue) .compact_blank! end |