diff --git a/README.md b/README.md index ab5175c..7b833f7 100755 --- a/README.md +++ b/README.md @@ -385,4 +385,4 @@ Feel free to open an issue or drop [me](mailto:thomas.pollet+no+spam+@gmail.com)
Thanks I developed this code when I worked at [Excellium Services](https://www.excellium-services.com/). They allowed me to open source it when I stopped working there. -
\ No newline at end of file + diff --git a/safrs/safrs_api.py b/safrs/safrs_api.py index a910b96..174b8b2 100755 --- a/safrs/safrs_api.py +++ b/safrs/safrs_api.py @@ -67,6 +67,7 @@ def __init__( """ self._custom_swagger = kwargs.pop("custom_swagger", {}) + self.swaggerui_blueprint = swaggerui_blueprint kwargs["default_mediatype"] = "application/vnd.api+json" app_db = kwargs.pop("app_db", None) safrs.SAFRS(app, app_db=app_db, prefix=prefix, json_encoder=json_encoder, swaggerui_blueprint=swaggerui_blueprint, **kwargs) @@ -136,7 +137,7 @@ class Class_API(SAFRSRestAPI): api_class_name = f"{safrs_object._s_type}_API" # name for dynamically generated classes RESOURCE_URL_FMT = get_config("RESOURCE_URL_FMT") # configurable resource collection url formatter url = RESOURCE_URL_FMT.format(url_prefix, safrs_object._s_collection_name) - swagger_decorator = swagger_doc(safrs_object) + swagger_decorator = swagger_doc(safrs_object) if self.swaggerui_blueprint else lambda x : x api_class = api_decorator(type(api_class_name, (rest_api,), properties), swagger_decorator) safrs.log.info(f"Exposing {safrs_object._s_collection_name} on {url}, endpoint: {endpoint}")