|
1 | 1 | import re
|
2 |
| - |
3 |
| -from apispec import BasePlugin |
4 | 2 | from copy import deepcopy
|
5 | 3 |
|
6 |
| -from apispec.ext.marshmallow import ( |
7 |
| - MarshmallowPlugin as _MarshmallowPlugin, |
8 |
| -) |
| 4 | +from apispec import BasePlugin |
| 5 | +from apispec.ext.marshmallow import MarshmallowPlugin as _MarshmallowPlugin |
9 | 6 | from apispec.ext.marshmallow import OpenAPIConverter
|
10 | 7 | from flask.views import http_method_funcs
|
11 | 8 |
|
12 | 9 | from .. import fields
|
13 | 10 | from ..json.schemas import schema_to_json
|
14 |
| -from ..schema import EventSchema, ActionSchema |
| 11 | +from ..schema import ActionSchema, EventSchema |
15 | 12 | from ..utilities import get_docstring, get_summary, merge
|
16 |
| -from .utilities import ensure_schema, get_marshamallow_plugin |
17 | 13 | from ..views import ActionView, EventView, PropertyView, View
|
| 14 | +from .utilities import ensure_schema, get_marshamallow_plugin |
18 | 15 |
|
19 | 16 |
|
20 | 17 | class ExtendedOpenAPIConverter(OpenAPIConverter):
|
@@ -102,11 +99,17 @@ def spec_for_interaction(cls, interaction):
|
102 | 99 | "parameters": [],
|
103 | 100 | }
|
104 | 101 | # Allow custom responses from the class, overridden by the method
|
105 |
| - d[method]["responses"].update(deepcopy(getattr(interaction, "responses", {}))) |
| 102 | + d[method]["responses"].update( |
| 103 | + deepcopy(getattr(interaction, "responses", {})) |
| 104 | + ) |
106 | 105 | d[method]["responses"].update(deepcopy(getattr(prop, "responses", {})))
|
107 | 106 | # Allow custom parameters from the class & method
|
108 |
| - d[method]["parameters"].extend(deepcopy(getattr(interaction, "parameters", {}))) |
109 |
| - d[method]["parameters"].extend(deepcopy(getattr(prop, "parameters", {}))) |
| 107 | + d[method]["parameters"].extend( |
| 108 | + deepcopy(getattr(interaction, "parameters", {})) |
| 109 | + ) |
| 110 | + d[method]["parameters"].extend( |
| 111 | + deepcopy(getattr(prop, "parameters", {})) |
| 112 | + ) |
110 | 113 | return d
|
111 | 114 |
|
112 | 115 | @classmethod
|
|
0 commit comments