Skip to content

Commit cb4cbdc

Browse files
committed
updated README.md
1 parent 63a871e commit cb4cbdc

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ import os
256256

257257
from ellar.constants import ELLAR_CONFIG_MODULE
258258
from ellar.core.factory import AppFactory
259-
from ellar.openapi import OpenAPIDocumentModule, OpenAPIDocumentBuilder
259+
from ellar.openapi import OpenAPIDocumentModule, OpenAPIDocumentBuilder, SwaggerDocumentGenerator
260260
from .root_module import ApplicationModule
261261

262262
application = AppFactory.create_from_app_module(
@@ -273,8 +273,12 @@ document_builder.set_title('CarSite API') \
273273
.set_license('MIT Licence', url='https://www.google.com')
274274

275275
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)
278282
```
279283

280284
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
303307
- Documentation - (in progress)
304308
- Interceptors - [Aspect Oriented Programming](https://en.wikipedia.org/wiki/Aspect-oriented_programming) (AOP) technique
305309
- Database Plugin with [Encode/ORM](https://github.com/encode/orm)
306-
- API Throttling

0 commit comments

Comments
 (0)