0

so, i'm trying to use custom abort message while using SwaggerClient. when using flask restful abort function, i can see the abort message on the SwaggerUI. but when i'm trying to see the error message while using the python module, im getting bravado.exception error code. i tried to use @namespace.response decorator, i tried to use "also_return_response": True, "disable_fallback_results": True and still, no hope. i would love to get some help/hints etc..

some of my code:

_api = Api(_app, version='1.0', title=self.name, description=self.name, errors = errors, )


NAMESPACE = "test"
namespace = _api.namespace(NAMESPACE, description=NAMESPACE)

@namespace.route("/error")
class SystemStatus(Resource):
    @namespace.doc("status")
    # @namespace.response(409, "Missing Parameter")
    def get(self):
        _api.abort(409, "testError")

and the usage of the SwaggerCLient:

def testing2(self):
        print("In testing2")
        return self.swagger_client.test.status().response()

Error for example: bravado.exception.HTTPConflict: 409 CONFLICT: Response specification matching http status_code 409 not found for operation Operation(status). Either add a response specification for the status_code or use a 'default' response.

and the UI: SwaggerUIResponse

dor mordehcai
  • 102
  • 1
  • 1
  • 6

0 Answers0