Class: Jsapi::Meta::Schema::String
- Includes:
- Conversion
- Defined in:
- lib/jsapi/meta/schema/string.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#format ⇒ Object
:attr: format The optional format of a string.
-
#max_length ⇒ Object
:attr: max_length The maximum length of a string.
-
#max_length=(value) ⇒ Object
:nodoc:.
-
#min_length ⇒ Object
:attr: min_length The minimum length of a string.
-
#min_length=(value) ⇒ Object
:nodoc:.
-
#pattern ⇒ Object
:attr: pattern The regular expression a string must match.
-
#pattern=(value) ⇒ Object
:nodoc:.
-
#to_json_schema ⇒ Object
:nodoc:.
-
#to_openapi ⇒ Object
:nodoc:.
Methods included from Conversion
Methods inherited from Base
#default, #deprecated, #description, #enum, #enum=, #examples, #existence, #external_docs, #initialize, #nullable?, #title, #type
Methods inherited from Base
#initialize, #inspect, #reference?, #resolve
Methods included from Attributes::ClassMethods
Constructor Details
This class inherits a constructor from Jsapi::Meta::Schema::Base
Instance Method Details
#format ⇒ Object
:attr: format The optional format of a string. Possible values are:
-
"date" -
"date-time"
16 |
# File 'lib/jsapi/meta/schema/string.rb', line 16 attribute :format, ::String, values: %w[date date-time] |
#max_length ⇒ Object
:attr: max_length The maximum length of a string.
21 |
# File 'lib/jsapi/meta/schema/string.rb', line 21 attribute :max_length, writer: false |
#max_length=(value) ⇒ Object
:nodoc:
33 34 35 36 |
# File 'lib/jsapi/meta/schema/string.rb', line 33 def max_length=(value) # :nodoc: add_validation('max_length', Validation::MaxLength.new(value)) @max_length = value end |
#min_length ⇒ Object
:attr: min_length The minimum length of a string.
26 |
# File 'lib/jsapi/meta/schema/string.rb', line 26 attribute :min_length, writer: false |
#min_length=(value) ⇒ Object
:nodoc:
38 39 40 41 |
# File 'lib/jsapi/meta/schema/string.rb', line 38 def min_length=(value) # :nodoc: add_validation('min_length', Validation::MinLength.new(value)) @min_length = value end |
#pattern ⇒ Object
:attr: pattern The regular expression a string must match.
31 |
# File 'lib/jsapi/meta/schema/string.rb', line 31 attribute :pattern, writer: false |
#pattern=(value) ⇒ Object
:nodoc:
43 44 45 46 |
# File 'lib/jsapi/meta/schema/string.rb', line 43 def pattern=(value) # :nodoc: add_validation('pattern', Validation::Pattern.new(value)) @pattern = value end |
#to_json_schema ⇒ Object
:nodoc:
48 49 50 |
# File 'lib/jsapi/meta/schema/string.rb', line 48 def to_json_schema # :nodoc: format ? super.merge(format: format) : super end |
#to_openapi ⇒ Object
:nodoc:
52 53 54 |
# File 'lib/jsapi/meta/schema/string.rb', line 52 def to_openapi(*) # :nodoc: format ? super.merge(format: format) : super end |