Skip to content

Commit

Permalink
Change default spec path to openapi.json
Browse files Browse the repository at this point in the history
  • Loading branch information
greyli committed Jan 20, 2021
1 parent d517641 commit 09d0d27
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apitoolkit/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def init_app(self, app):
self.title = app.config.get('APITOOLKIT_TITLE', 'APIToolkit')
self.version = app.config.get('APITOOLKIT_VERSION', '1.0.0')
self.apispec_path = app.config.get('APITOOLKIT_APISPEC_PATH',
'/apispec.json')
'/openapi.json')
self.swagger_ui_path = app.config.get('APITOOLKIT_SWAGGER_UI_PATH', '/docs')
self.redoc_path = app.config.get('APITOOLKIT_REDOC_PATH', '/redoc')
self.tags = app.config.get('APITOOLKIT_TAGS')
Expand Down
4 changes: 2 additions & 2 deletions docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ The two-phase initialization style is also supported::

Once APIToolkit is initialized, automatically generated documentation can be
accessed at the */docs* URL. The raw OpenAPI documentation data in JSON format
can be accessed at the */apispec.json* URL. Both URLs can be changed in the
can be accessed at the */openapi.json* URL. Both URLs can be changed in the
configuration if desired.

Configuration
Expand All @@ -91,7 +91,7 @@ Name Type Default Description
============================== ====== =============== ==============================================================================================
``APITOOLKIT_TITLE`` String APIToolkit The API's title.
``APITOOLKIT_VERSION`` String 1.0.0 The API's version.
``APITOOLKIT_APISPEC_PATH`` String */apispec.json* The URL path where the JSON OpenAPI specification for this project is served.
``APITOOLKIT_APISPEC_PATH`` String */openapi.json* The URL path where the JSON OpenAPI specification for this project is served.
``APITOOLKIT_SWAGGER_UI_PATH`` String */swaggger* The URL path where the Swagger UI documentation is served. Set it to ``None`` to disable it.
``APITOOLKIT_REDOC_PATH`` String */redoc* The URL path where the Redoc documentation is served. Set it to ``None`` to disable it.
``APITOOLKIT_TAGS`` List ``None`` The list of ordered tags to include in the documentation, if the default order is not optimal.
Expand Down
8 changes: 4 additions & 4 deletions tests/test_apitoolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def foo():

client = app.test_client()

rv = client.get('/apispec.json')
rv = client.get('/openapi.json')
assert rv.status_code == 200
validate_spec(rv.json)
assert rv.json['openapi'] == '3.0.2'
Expand Down Expand Up @@ -318,7 +318,7 @@ def update_user(id):

client = app.test_client()

rv = client.get('/apispec.json')
rv = client.get('/openapi.json')
assert rv.status_code == 200
validate_spec(rv.json)
assert rv.json['paths']['/users']['get']['summary'] == 'Get Users'
Expand Down Expand Up @@ -352,7 +352,7 @@ def get_article(user_id, article_id):

client = app.test_client()

rv = client.get('/apispec.json')
rv = client.get('/openapi.json')
assert rv.status_code == 200
validate_spec(rv.json)
assert rv.json['paths']['/strings/{some_string}'][
Expand Down Expand Up @@ -395,7 +395,7 @@ def delete_user(id):

client = app.test_client()

rv = client.get('/apispec.json')
rv = client.get('/openapi.json')
assert rv.status_code == 200
validate_spec(rv.json)
assert rv.json['paths']['/users']['get']['summary'] == 'Get Users'
Expand Down

0 comments on commit 09d0d27

Please sign in to comment.