Class: SecurityPentestPlanner::OpenAPIParser::Parameter
- Inherits:
-
Struct
- Object
- Struct
- SecurityPentestPlanner::OpenAPIParser::Parameter
- Defined in:
- lib/security_pentest_planner/openapi_parser.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#location ⇒ Object
Returns the value of attribute location.
-
#name ⇒ Object
Returns the value of attribute name.
-
#required ⇒ Object
Returns the value of attribute required.
-
#schema ⇒ Object
Returns the value of attribute schema.
Instance Method Summary collapse
- #date_param? ⇒ Boolean
- #enum_param? ⇒ Boolean
- #enum_values ⇒ Object
- #tenant_header? ⇒ Boolean
- #timezone_header? ⇒ Boolean
- #type ⇒ Object
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description
22 23 24 |
# File 'lib/security_pentest_planner/openapi_parser.rb', line 22 def description @description end |
#location ⇒ Object
Returns the value of attribute location
22 23 24 |
# File 'lib/security_pentest_planner/openapi_parser.rb', line 22 def location @location end |
#name ⇒ Object
Returns the value of attribute name
22 23 24 |
# File 'lib/security_pentest_planner/openapi_parser.rb', line 22 def name @name end |
#required ⇒ Object
Returns the value of attribute required
22 23 24 |
# File 'lib/security_pentest_planner/openapi_parser.rb', line 22 def required @required end |
#schema ⇒ Object
Returns the value of attribute schema
22 23 24 |
# File 'lib/security_pentest_planner/openapi_parser.rb', line 22 def schema @schema end |
Instance Method Details
#date_param? ⇒ Boolean
42 43 44 |
# File 'lib/security_pentest_planner/openapi_parser.rb', line 42 def date_param? location == "query" && name.match?(DATE_PARAM_PATTERN) end |
#enum_param? ⇒ Boolean
50 51 52 |
# File 'lib/security_pentest_planner/openapi_parser.rb', line 50 def enum_param? enum_values.any? || schema&.dig("items", "enum")&.any? end |
#enum_values ⇒ Object
30 31 32 |
# File 'lib/security_pentest_planner/openapi_parser.rb', line 30 def enum_values schema&.dig("enum") || schema&.dig("items", "enum") || [] end |
#tenant_header? ⇒ Boolean
38 39 40 |
# File 'lib/security_pentest_planner/openapi_parser.rb', line 38 def tenant_header? location == "header" && name.match?(TENANT_HEADER_PATTERN) end |
#timezone_header? ⇒ Boolean
46 47 48 |
# File 'lib/security_pentest_planner/openapi_parser.rb', line 46 def timezone_header? location == "header" && name.match?(TIMEZONE_HEADER_PATTERN) end |
#type ⇒ Object
34 35 36 |
# File 'lib/security_pentest_planner/openapi_parser.rb', line 34 def type schema&.dig("type") end |