|
24 | 24 | module TheApi
|
25 | 25 | module Entities
|
26 | 26 | class TypedDefinition < Grape::Entity
|
27 |
| - expose :prop_integer, documentation: { type: Integer, desc: 'prop_integer' } |
28 |
| - expose :prop_long, documentation: { type: Numeric, desc: 'prop_long' } |
29 |
| - expose :prop_float, documentation: { type: Float, desc: 'prop_float' } |
30 |
| - expose :prop_double, documentation: { type: BigDecimal, desc: 'prop_double' } |
31 |
| - expose :prop_string, documentation: { type: String, desc: 'prop_string' } |
32 |
| - expose :prop_symbol, documentation: { type: Symbol, desc: 'prop_symbol' } |
33 |
| - expose :prop_date, documentation: { type: Date, desc: 'prop_date' } |
34 |
| - expose :prop_date_time, documentation: { type: DateTime, desc: 'prop_date_time' } |
35 |
| - expose :prop_time, documentation: { type: Time, desc: 'prop_time' } |
36 |
| - expose :prop_password, documentation: { type: 'password', desc: 'prop_password' } |
37 |
| - expose :prop_email, documentation: { type: 'email', desc: 'prop_email' } |
38 |
| - expose :prop_boolean, documentation: { type: Virtus::Attribute::Boolean, desc: 'prop_boolean' } |
39 |
| - expose :prop_file, documentation: { type: File, desc: 'prop_file' } |
40 |
| - expose :prop_json, documentation: { type: JSON, desc: 'prop_json' } |
| 27 | + expose :prop_integer, documentation: { type: Integer, desc: 'prop_integer description' } |
| 28 | + expose :prop_long, documentation: { type: Numeric, desc: 'prop_long description' } |
| 29 | + expose :prop_float, documentation: { type: Float, desc: 'prop_float description' } |
| 30 | + expose :prop_double, documentation: { type: BigDecimal, desc: 'prop_double description' } |
| 31 | + expose :prop_string, documentation: { type: String, desc: 'prop_string description' } |
| 32 | + expose :prop_symbol, documentation: { type: Symbol, desc: 'prop_symbol description' } |
| 33 | + expose :prop_date, documentation: { type: Date, desc: 'prop_date description' } |
| 34 | + expose :prop_date_time, documentation: { type: DateTime, desc: 'prop_date_time description' } |
| 35 | + expose :prop_time, documentation: { type: Time, desc: 'prop_time description' } |
| 36 | + expose :prop_password, documentation: { type: 'password', desc: 'prop_password description' } |
| 37 | + expose :prop_email, documentation: { type: 'email', desc: 'prop_email description' } |
| 38 | + expose :prop_boolean, documentation: { type: Virtus::Attribute::Boolean, desc: 'prop_boolean description' } |
| 39 | + expose :prop_file, documentation: { type: File, desc: 'prop_file description' } |
| 40 | + expose :prop_json, documentation: { type: JSON, desc: 'prop_json description' } |
41 | 41 | end
|
42 | 42 | end
|
43 | 43 |
|
@@ -102,20 +102,20 @@ def app
|
102 | 102 |
|
103 | 103 | specify do
|
104 | 104 | expect(subject['definitions']['TypedDefinition']['properties']).to eql({
|
105 |
| - "prop_integer"=>{"type"=>"integer", "format"=>"int32"}, |
106 |
| - "prop_long"=>{"type"=>"integer", "format"=>"int64"}, |
107 |
| - "prop_float"=>{"type"=>"number", "format"=>"float"}, |
108 |
| - "prop_double"=>{"type"=>"number", "format"=>"double"}, |
109 |
| - "prop_string"=>{"type"=>"string"}, |
110 |
| - "prop_symbol"=>{"type"=>"string"}, |
111 |
| - "prop_date"=>{"type"=>"string", "format"=>"date"}, |
112 |
| - "prop_date_time"=>{"type"=>"string", "format"=>"date-time"}, |
113 |
| - "prop_time"=>{"type"=>"string", "format"=>"date-time"}, |
114 |
| - "prop_password"=>{"type"=>"string", "format"=>"password"}, |
115 |
| - "prop_email"=>{"type"=>"string", "format"=>"email"}, |
116 |
| - "prop_boolean"=>{"type"=>"boolean"}, |
117 |
| - "prop_file"=>{"type"=>"file"}, |
118 |
| - "prop_json"=>{"type"=>"json"} |
| 105 | + "prop_integer"=>{"type"=>"integer", "format"=>"int32", "description"=>"prop_integer description"}, |
| 106 | + "prop_long"=>{"type"=>"integer", "format"=>"int64", "description"=>"prop_long description"}, |
| 107 | + "prop_float"=>{"type"=>"number", "format"=>"float", "description"=>"prop_float description"}, |
| 108 | + "prop_double"=>{"type"=>"number", "format"=>"double", "description"=>"prop_double description"}, |
| 109 | + "prop_string"=>{"type"=>"string", "description"=>"prop_string description"}, |
| 110 | + "prop_symbol"=>{"type"=>"string", "description"=>"prop_symbol description"}, |
| 111 | + "prop_date"=>{"type"=>"string", "format"=>"date", "description"=>"prop_date description"}, |
| 112 | + "prop_date_time"=>{"type"=>"string", "format"=>"date-time", "description"=>"prop_date_time description"}, |
| 113 | + "prop_time"=>{"type"=>"string", "format"=>"date-time", "description"=>"prop_time description"}, |
| 114 | + "prop_password"=>{"type"=>"string", "format"=>"password", "description"=>"prop_password description"}, |
| 115 | + "prop_email"=>{"type"=>"string", "format"=>"email", "description"=>"prop_email description"}, |
| 116 | + "prop_boolean"=>{"type"=>"boolean", "description"=>"prop_boolean description"}, |
| 117 | + "prop_file"=>{"type"=>"file", "description"=>"prop_file description"}, |
| 118 | + "prop_json"=>{"type"=>"json", "description"=>"prop_json description"} |
119 | 119 | })
|
120 | 120 | end
|
121 | 121 | end
|
0 commit comments