Class: Swagger::Blocks::Nodes::PropertyNode
- Inherits:
-
Node
- Object
- Node
- Swagger::Blocks::Nodes::PropertyNode
- Defined in:
- lib/api_schema/patches/property_node.rb
Instance Method Summary collapse
Instance Method Details
#property_schema_for(serializer) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/api_schema/patches/property_node.rb', line 9 def property_schema_for(serializer) property serializer.name do key :type, serializer.type key :description, serializer.description requires serializer.required_fields serializer.fields.each do |f| property f.name do key :type, f.type key :format, f.format if f.format key :description, f.description end end serializer.references.each do |r| property_schema_for(r) end end end |
#requires(fields) ⇒ Object
5 6 7 |
# File 'lib/api_schema/patches/property_node.rb', line 5 def requires(fields) key :required, fields end |