responder icon indicating copy to clipboard operation
responder copied to clipboard

Problems with OpenAPI subsystem

Open amotl opened this issue 9 months ago • 2 comments

@michela reported problems with upcoming 3.0.0 version and OpenAPI per https://github.com/kennethreitz/responder/issues/578#issuecomment-2638777762.

Using the following, I'm still getting errors with openapi as below

uv pip install --upgrade 'responder[full]>=3.0.0.dev0'

jinja2.exceptions.TemplateNotFound: 'swagger_ui.html' not found in search path: '/home/michela/.local/share/virtualenvs/grapho-server-jJZ_4mcz/lib/python3.12/site-packages/responder/ext/openapi/docs'

I tried installing openapi separately but can't find the UI templates anywhere.

Also, when running in development mode, the docs folder doesn't get copied to site-packages, and manual copying there just resulted in complaints about /schema.yml not found.

amotl avatar Feb 06 '25 23:02 amotl

Dear @michela,

thank you so much for reporting this flaw. I have to admit I did not touch the {graphql,openapi,schema} subsystems too much, other than refactoring its code and taking care no test cases break. My primary concern and focus has been to resolve dependency problems, and re-add the CLI interface, because it got lost on the main branch.

According to the kind of problem you are reporting, maybe some elements of the OpenAPI subsytem are also missing from the source tree, so they would need to be dugged out of the project's history, as we did with the CLI interface?

With kind regards, Andreas.

amotl avatar Feb 06 '25 23:02 amotl

maybe some elements of the OpenAPI subsytem are also missing from the source tree

Yes, could use a test for /docs

/schema.yml gives 404

and re missing /docs templates, is this a ext packaging issue? I'm new to the extensions feature so not sure what though. I've had to hit pause but will keep digging when I can.

The ext/openapi/docs folder in main which did not get copied to site-packages, weren't any use when manually copied so there's a deeper issue here.

I tested the both the new and old ways of setting openapi as described in the tour docs here so don't think it's a syntax issue.

michela avatar Feb 07 '25 00:02 michela