aiohttp-apispec icon indicating copy to clipboard operation
aiohttp-apispec copied to clipboard

@json_schema is missing in sub-app API spec

Open m3th0d opened this issue 5 years ago • 0 comments

Hi,

I have 2 aiohttp sub-apps. Both of them handle same route with @json_schema(SomeSchema) applied. I'd like to have separate Swagger UI + API spec for each of the sub-apps

So I call setup_aiohttp_apispec() for the first sub-app and then for the second one. When I run my app, the first created sub-app contains Some schema in spec definitions. But the second one doesn't. So I get

Could not resolve reference: Could not resolve pointer: /definitions/Some does not exist in document

error in Swagger UI for the endpoint in the second sub-app

It's the only schema missing in the spec. Also I use @docs (responses), @match_info_schema, @querystring_schema. All of them work fine in this scenario

Validation still works fine for missing schema though

m3th0d avatar Dec 24 '19 11:12 m3th0d