Comments (4)
After calling _register()
you will find it in app["swagger_dict"]
.
But be careful, it is private method. So it can be changed somedays.
Simplest and most correct way is to start an app before it and just get it from app["swagger_dict"]
or with http get.
from aiohttp-apispec.
No, I don't need to start an app because in cleanup_ctx
may occur heavy logic like downloading 500Mb ML model or bigger...
Need some way to get swagger.json without running web.Application. And I can't calling _register()
because it is protected method and as you say it can be changed somedays.
Any idea?)
from aiohttp-apispec.
Some ideas:
- Use
_register()
and freeze the library version in your requirements (it is must-have for all production projects). - Use subapp for api logic and start it without starting parent app.
- Use some ENV/config variables to control your heavy logic.
from aiohttp-apispec.
@v-v-vishnevskiy Now you have can do it! Use parameter in_place=True
setup_aiohttp_apispec(app, ..., in_place=True)
But be sure all routes are added to router. Added in 1.4.0
from aiohttp-apispec.
Related Issues (20)
- Validation does not work in schema with two fields HOT 1
- webargs 6 HOT 1
- Incompatibility with apispec 4.0.0 -> schema2parameters() now needs an argument "location" HOT 4
- response_schema decor doesn't respect marshamallow datetimeformat
- Schema for single value? HOT 1
- Installation through conda-forge
- Validation middleware not validating top level fields when using nested dictionaries.
- Bump apispec to 4.6
- [Webargs 6.0+] Validation middleware does not support unknown field behavior specified with a Marshmallow 3 schema HOT 3
- aiohttp-apispec 2.2.1 provides a version of Swagger-UI that is vulnerable to XSS HOT 1
- Release aiohttp-apispec to pypi HOT 2
- Fix failed tests in CI HOT 1
- ImportError: cannot import name 'soft_unicode' from 'markupsafe' HOT 5
- Failed building wheel for aiohttp-apispec HOT 3
- docs: RequestSchema(strict=True) raises TypeError
- Python 3.10 support
- User-provided dumps to build swagger_dict
- Request schema not validating unknown fields in request json HOT 1
- Missing the fields from Response
- Add options to have relative url param.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiohttp-apispec.