Skip to content

Commit

Permalink
fix, change openapi tags and swagger access URL (breaking) (#1422)
Browse files Browse the repository at this point in the history
* fix, change openapi tags and swagger access URL (breaking)

* fix, change docs
  • Loading branch information
dpgaspar committed Jul 3, 2020
1 parent 85567d5 commit f26cf7f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/rest_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ So our spec for a method that accepts two HTTP verbs::


To access Swagger UI you must enable ``FAB_API_SWAGGER_UI = True`` on your config file
then goto ``http://localhost:8080/swaggerview/v1`` for OpenAPI **v1** definitions
then goto ``http://localhost:8080/swagger/v1`` for OpenAPI **v1** definitions
On Swagger UI our example API looks like:

.. image:: ./images/swagger001.png
Expand Down Expand Up @@ -611,7 +611,7 @@ that can be safely serialized and deserialized. Let's recall our Model definitio
def __repr__(self):
return self.name

Swagger UI API representation for groups (http://localhost:8080/swaggerview/v1):
Swagger UI API representation for groups (http://localhost:8080/swagger/v1):

.. image:: ./images/swagger002.png
:width: 70%
Expand Down
1 change: 1 addition & 0 deletions flask_appbuilder/api/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def _create_api_spec(version):

class SwaggerView(BaseView):

route_base = "/swagger"
default_view = "ui"
openapi_uri = "/api/{}/_openapi"

Expand Down
1 change: 1 addition & 0 deletions flask_appbuilder/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def add_separator(self, category=""):

class MenuApi(BaseApi):
resource_name = "menu"
openapi_spec_tag = "Menu"

@expose("/", methods=["GET"])
@protect(allow_browser_login=True)
Expand Down
1 change: 1 addition & 0 deletions flask_appbuilder/security/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class SecurityApi(BaseApi):

resource_name = "security"
version = API_SECURITY_VERSION
openapi_spec_tag = "Security"

def add_apispec_components(self, api_spec):
super(SecurityApi, self).add_apispec_components(api_spec)
Expand Down

0 comments on commit f26cf7f

Please sign in to comment.