Class: Shale::Schema::JSONGenerator::String Private
- Defined in:
- lib/shale/schema/json_generator/string.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class representing JSON Schema string type
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#as_type ⇒ Hash
private
Return JSON Schema fragment as Ruby Hash.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Shale::Schema::JSONGenerator::Base
Instance Method Details
#as_type ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return JSON Schema fragment as Ruby Hash
17 18 19 20 21 22 23 24 |
# File 'lib/shale/schema/json_generator/string.rb', line 17 def as_type { 'type' => 'string', 'format' => schema[:format], 'minLength' => schema[:min_length], 'maxLength' => schema[:max_length], 'pattern' => schema[:pattern], 'description' => schema[:description] }.compact end |