@@ -118,26 +118,23 @@ def get_response_schema_section(self, response: td.Response) -> Dict[str, Any]:
118
118
parameterized_path , _ = self .loader .resolve_path (response .request ["PATH_INFO" ], method = response_method )
119
119
paths_object = self .get_key_value (schema , "paths" )
120
120
121
- pretty_routes = "\n \t • " .join (paths_object .keys ())
122
121
route_object = self .get_key_value (
123
122
paths_object ,
124
123
parameterized_path ,
125
- f"\n \n Valid routes include: \n \n \ t • { pretty_routes } " ,
124
+ f"\n \n Undocumented route { parameterized_path } . \n \n Documented routes: " + " \n \t • " . join ( paths_object . keys ()) ,
126
125
)
127
126
128
- str_methods = ", " .join (method .upper () for method in route_object .keys () if method .upper () != "PARAMETERS" )
129
127
method_object = self .get_key_value (
130
128
route_object ,
131
129
response_method ,
132
- f"\n \n Available methods include : { str_methods } ." ,
130
+ f"\n \n Undocumented method: { response_method } . \n \n Documented methods : { [ method . lower () for method in route_object . keys () if method . lower () != 'parameters' ] } ." ,
133
131
)
134
132
135
133
responses_object = self .get_key_value (method_object , "responses" )
136
- keys = ", " .join (str (key ) for key in responses_object .keys ())
137
134
status_code_object = self .get_status_code (
138
135
responses_object ,
139
136
response .status_code ,
140
- f"\n \n Undocumented status code: { response .status_code } .\n \n Documented responses include : { keys } . " ,
137
+ f"\n \n Undocumented status code: { response .status_code } .\n \n Documented status codes : { list ( responses_object . keys ()) } . " ,
141
138
)
142
139
143
140
if "openapi" not in schema :
@@ -146,12 +143,12 @@ def get_response_schema_section(self, response: td.Response) -> Dict[str, Any]:
146
143
content_object = self .get_key_value (
147
144
status_code_object ,
148
145
"content" ,
149
- f"No content documented for method: { response_method } , path: { parameterized_path } " ,
146
+ f"\n \n No content documented for method: { response_method } , path: { parameterized_path } " ,
150
147
)
151
148
json_object = self .get_key_value (
152
149
content_object ,
153
150
"application/json" ,
154
- f"no `application/json` responses documented for method: { response_method } , path: { parameterized_path } " ,
151
+ f"\n \n No `application/json` responses documented for method: { response_method } , path: { parameterized_path } " ,
155
152
)
156
153
return self .get_key_value (json_object , "schema" )
157
154
0 commit comments