Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/thomaxxl/safrs
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaxxl committed Jul 2, 2024
2 parents 4031a62 + e3c1b3e commit 1b4fd50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,4 +385,4 @@ Feel free to open an issue or drop [me](mailto:[email protected])
<details>
<summary>Thanks</summary>
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.
</details>
</details>
3 changes: 2 additions & 1 deletion safrs/safrs_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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}")
Expand Down

0 comments on commit 1b4fd50

Please sign in to comment.