Class: OpenapiFirst::OperationSchemas
- Inherits:
-
Object
- Object
- OpenapiFirst::OperationSchemas
- Defined in:
- lib/openapi_first/operation_schemas.rb
Overview
This class is basically a cache for JSON Schemas of parameters
Instance Attribute Summary collapse
-
#operation ⇒ Object
readonly
Returns the value of attribute operation.
Instance Method Summary collapse
- #cookie_parameters_schema ⇒ Object
- #header_parameters_schema ⇒ Object
-
#initialize(operation) ⇒ OperationSchemas
constructor
A new instance of OperationSchemas.
-
#path_parameters_schema ⇒ Object
Return JSON Schema of for all path parameters.
-
#query_parameters_schema ⇒ Object
Return JSON Schema of for all query parameters.
Constructor Details
#initialize(operation) ⇒ OperationSchemas
Returns a new instance of OperationSchemas.
10 11 12 |
# File 'lib/openapi_first/operation_schemas.rb', line 10 def initialize(operation) @operation = operation end |
Instance Attribute Details
#operation ⇒ Object (readonly)
Returns the value of attribute operation.
14 15 16 |
# File 'lib/openapi_first/operation_schemas.rb', line 14 def operation @operation end |
Instance Method Details
#cookie_parameters_schema ⇒ Object
30 31 32 |
# File 'lib/openapi_first/operation_schemas.rb', line 30 def @cookie_parameters_schema ||= build_json_schema(operation.) end |
#header_parameters_schema ⇒ Object
26 27 28 |
# File 'lib/openapi_first/operation_schemas.rb', line 26 def header_parameters_schema @header_parameters_schema ||= build_json_schema(operation.header_parameters) end |
#path_parameters_schema ⇒ Object
Return JSON Schema of for all path parameters
22 23 24 |
# File 'lib/openapi_first/operation_schemas.rb', line 22 def path_parameters_schema @path_parameters_schema ||= build_json_schema(operation.path_parameters) end |
#query_parameters_schema ⇒ Object
Return JSON Schema of for all query parameters
17 18 19 |
# File 'lib/openapi_first/operation_schemas.rb', line 17 def query_parameters_schema @query_parameters_schema ||= build_json_schema(operation.query_parameters) end |