11from ..view import View
22from apispec import APISpec
33
4- from ...core .utilities import get_docstring , get_summary , rupdate
4+ from ...core .utilities import get_docstring , get_summary , merge
55from .paths import rule_to_path , rule_to_params
66from .utilities import convert_schema , update_spec
77
@@ -38,7 +38,7 @@ def rule_to_apispec_path(rule: Rule, view: View, spec: APISpec):
3838
3939 # Add extra parameters
4040 # build_spec(view) guarantees view.__apispec__ exists
41- rupdate (params , view .__apispec__ )
41+ params = merge (params , view .__apispec__ )
4242
4343 return params
4444
@@ -64,7 +64,7 @@ def view_to_apispec_operations(view: View, spec: APISpec):
6464 # Populate missing spec parameters
6565 build_spec (method_function , inherit_from = view )
6666
67- rupdate (
67+ ops [ method ] = merge (
6868 ops [method ],
6969 {
7070 "description" : getattr (method_function , "__apispec__" ).get (
@@ -75,7 +75,9 @@ def view_to_apispec_operations(view: View, spec: APISpec):
7575 },
7676 )
7777
78- rupdate (ops [method ], method_to_apispec_operation (method_function , spec ))
78+ ops [method ] = merge (
79+ ops [method ], method_to_apispec_operation (method_function , spec )
80+ )
7981
8082 return ops
8183
@@ -97,7 +99,7 @@ def method_to_apispec_operation(method: callable, spec: APISpec):
9799
98100 op = {}
99101 if "_params" in apispec :
100- rupdate (
102+ op = merge (
101103 op ,
102104 {
103105 "requestBody" : {
@@ -112,7 +114,7 @@ def method_to_apispec_operation(method: callable, spec: APISpec):
112114
113115 if "_schema" in apispec :
114116 for code , schema in apispec .get ("_schema" , {}).items ():
115- rupdate (
117+ op = merge (
116118 op ,
117119 {
118120 "responses" : {
@@ -129,7 +131,7 @@ def method_to_apispec_operation(method: callable, spec: APISpec):
129131 )
130132 else :
131133 # If no explicit responses are known, populate with defaults
132- rupdate (
134+ op = merge (
133135 op ,
134136 {
135137 "responses" : {
@@ -141,7 +143,7 @@ def method_to_apispec_operation(method: callable, spec: APISpec):
141143 # Bung in any extra swagger fields supplied
142144 for key , val in apispec .items ():
143145 if key not in ["_params" , "_schema" ]:
144- rupdate (op , {key : val })
146+ op = merge (op , {key : val })
145147
146148 return op
147149
0 commit comments