@@ -256,7 +256,7 @@ import os
256
256
257
257
from ellar.constants import ELLAR_CONFIG_MODULE
258
258
from ellar.core.factory import AppFactory
259
- from ellar.openapi import OpenAPIDocumentModule, OpenAPIDocumentBuilder
259
+ from ellar.openapi import OpenAPIDocumentModule, OpenAPIDocumentBuilder, SwaggerDocumentGenerator
260
260
from .root_module import ApplicationModule
261
261
262
262
application = AppFactory.create_from_app_module(
@@ -273,8 +273,12 @@ document_builder.set_title('CarSite API') \
273
273
.set_license(' MIT Licence' , url = ' https://www.google.com' )
274
274
275
275
document = document_builder.build_document(application)
276
- module = application.install_module(OpenAPIDocumentModule, document = document)
277
- module.setup_swagger_doc()
276
+ module = OpenAPIDocumentModule.setup(
277
+ document = document,
278
+ document_generator = SwaggerDocumentGenerator(),
279
+ guards = []
280
+ )
281
+ application.install_module(module)
278
282
```
279
283
280
284
Now we can test our API at [ http://127.0.0.1:8000/docs ] ( http://127.0.0.1:8000/docs#/ )
@@ -303,4 +307,3 @@ Project is still in development
303
307
- Documentation - (in progress)
304
308
- Interceptors - [ Aspect Oriented Programming] ( https://en.wikipedia.org/wiki/Aspect-oriented_programming ) (AOP) technique
305
309
- Database Plugin with [ Encode/ORM] ( https://github.com/encode/orm )
306
- - API Throttling
0 commit comments