@@ -135,16 +135,18 @@ class ActionView(View):
135
135
_cls_tags = {"actions" }
136
136
_deque = Deque () # Action queue
137
137
138
+ def get (self ):
139
+ queue_schema = build_action_schema (self .schema , self .args )(many = True )
140
+ return queue_schema .dump (self ._deque )
141
+
138
142
@classmethod
139
143
def get_apispec (cls ):
140
144
class_args = schema_to_json (cls .args )
141
- class_action_schema = schema_to_json (
142
- build_action_schema (cls .schema , cls .args )()
143
- )
144
- class_action_queue_schema = schema_to_json (
145
+ action_json_schema = schema_to_json (build_action_schema (cls .schema , cls .args )())
146
+ queue_json_schema = schema_to_json (
145
147
build_action_schema (cls .schema , cls .args )(many = True )
146
148
)
147
- class_schema = schema_to_json (cls .schema )
149
+ class_json_schema = schema_to_json (cls .schema )
148
150
d = {
149
151
"post" : {
150
152
"description" : getattr (cls , "description" , None ) or get_docstring (cls ),
@@ -163,9 +165,7 @@ def get_apispec(cls):
163
165
"content_type" : "application/json" ,
164
166
"description" : "Action started" ,
165
167
** (
166
- {"schema" : class_action_schema }
167
- if class_action_schema
168
- else {}
168
+ {"schema" : action_json_schema } if action_json_schema else {}
169
169
),
170
170
}
171
171
},
@@ -179,11 +179,7 @@ def get_apispec(cls):
179
179
200 : {
180
180
"content_type" : "application/json" ,
181
181
"description" : "Action started" ,
182
- ** (
183
- {"schema" : class_action_queue_schema }
184
- if class_action_queue_schema
185
- else {}
186
- ),
182
+ ** ({"schema" : queue_json_schema } if queue_json_schema else {}),
187
183
}
188
184
},
189
185
},
0 commit comments