@@ -7,10 +7,12 @@ module Entities
7
7
module Some
8
8
class Thing < Grape ::Entity
9
9
expose :text , documentation : { type : 'string' , desc : 'Content of something.' }
10
+ expose :name , documentation : { type : String , desc : 'Name of something.' }
10
11
end
11
12
12
13
class CombinedThing < Grape ::Entity
13
14
expose :text , documentation : { type : 'string' , desc : 'Content of something.' }
15
+ expose :created_at , documentation : { type : DateTime , desc : 'Creation of something.' }
14
16
end
15
17
end
16
18
end
@@ -47,7 +49,8 @@ def app
47
49
'Some::Thing' => {
48
50
'id' => 'Some::Thing' ,
49
51
'properties' => {
50
- 'text' => { 'type' => 'string' , 'description' => 'Content of something.' }
52
+ 'text' => { 'type' => 'string' , 'description' => 'Content of something.' } ,
53
+ 'name' => { 'type' => 'string' , 'description' => 'Name of something.' }
51
54
}
52
55
} )
53
56
end
@@ -60,15 +63,17 @@ def app
60
63
'Some::Thing' => {
61
64
'id' => 'Some::Thing' ,
62
65
'properties' => {
63
- 'text' => { 'type' => 'string' , 'description' => 'Content of something.' }
66
+ 'text' => { 'type' => 'string' , 'description' => 'Content of something.' } ,
67
+ 'name' => { 'type' => 'string' , 'description' => 'Name of something.' }
64
68
}
65
69
} )
66
70
67
71
expect ( json [ 'models' ] ) . to include (
68
72
'Some::CombinedThing' => {
69
73
'id' => 'Some::CombinedThing' ,
70
74
'properties' => {
71
- 'text' => { 'type' => 'string' , 'description' => 'Content of something.' }
75
+ 'text' => { 'type' => 'string' , 'description' => 'Content of something.' } ,
76
+ 'created_at' => { 'type' => 'dateTime' , 'description' => 'Creation of something.' }
72
77
}
73
78
} )
74
79
0 commit comments