0

Can I know how to disable flask restplus endpoint?

I am trying to do something like when a condition does not meet, the endpoint is disabled and cannot be accessed.

Is there a way we can do this in flask restplus or custom code is required?

I know that we can disable the endpoint in swagger documentation. However, that doesn't disable the endpoint as it stills can be accessed via curl. http://localhost:8080/api_endpoint/

Derek Lee
  • 475
  • 1
  • 6
  • 20

1 Answers1

0

Have a look at add_url_rule in the Flask docs:

From the Flask docs, http://flask.pocoo.org/docs/1.0/api/

Internally route() invokes add_url_rule() so if you want to customize the behavior via subclassing you only need to change this method.

For more information refer to URL Route Registrations.
fiacre
  • 1,150
  • 2
  • 9
  • 26