alanjds / drf-nested-routers

Nested Routers for Django Rest Framework
https://pypi.org/project/drf-nested-routers/
Apache License 2.0
1.68k stars 160 forks source link

add swagger check to NestedViewSetMixin #290

Closed dickermoshe closed 1 year ago

dickermoshe commented 1 year ago

A check for swagger_fake_view is done in the get_queryset function of the NestedViewSetMixin.
However this needs to be added to initialize_request for a schema to be generated by a request.

I was getting errors when using the drf_spectacular package to serve the schema at /schema
Adding this check to the initialize_request fixed this issue.

I don't know if this package is still maintained. Let me know if this is not going to be considered.

This package is awesome btw.
Thanks so much!

dickermoshe commented 1 year ago

I fixed tests by setting allowlist_externals to *. All test are now successful.

alanjds commented 1 year ago

Hi @dickermoshe. Thanks for reaching out.

The package is considered maintained, yet cause it is used in a lot of well-known projects, but I personally do not develop new features. People send update and compat (pull-)requests, I merge after CI passes, release to PyPI some weeks later, and that is :).

Feel free to contribute or to chat on the Gitter from the README.

If you can, please link here or in the code the reference of why this fixes the swagger thing?

And thanks for the code & tests contribution

dickermoshe commented 1 year ago

This should explain why it is needed https://drf-yasg.readthedocs.io/en/stable/openapi.html#a-note-on-limitations

the request the view sees will always be the request made against the schema view endpoint - e.g. GET /swagger.yaml

alanjds commented 1 year ago

Thanks for the link. Merging on master.

Should go to PyPI on the next release, after some weeks got given to let people using master to complain if something broke :+1:.

msaraac commented 1 year ago

When it will be released on pypi ? @alanjds

SukiCZ commented 11 months ago

Hi @alanjds Can this be released? :pray:

alanjds commented 10 months ago

Oh, sure. I will try to release a version today. Thanks for the nudge, @SukiCZ & @msaraac

alanjds commented 10 months ago

I just released the v0.93.5 on PyPI. Thanks for the continuous nudges. See ya.