Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New setting to exclude paths, preventing inclusion in analysis #93

Closed
jayvdb opened this issue Jun 11, 2020 · 2 comments
Closed

New setting to exclude paths, preventing inclusion in analysis #93

jayvdb opened this issue Jun 11, 2020 · 2 comments

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Jun 11, 2020

We have a number of paths in our API which we dont want included in the OpenAPI, because they are not used at the moment, and also because they are causing drf-spectacular to get confused about serializers.

The primary example is /oscarapi/admin which has a different set of objects with similar names as those under /oscarapi, because they are the 'admin' views of those objects with more details and write support. We anticipate having a different frontend app for the admins, and expose that as a separate OpenAPI. Not looking for any support wrt the second OpenAPI - it is moderately easy to do a second view with a fake filtered URLConf. I can (and am) also creating a specialised URLConf for the main API, but this is a bit more annoying because it is "almost everything except a few things" which IMO should be easy, and I suspect others would benefit from it, and not need to resort to my tom-foolery-approach.

@jayvdb
Copy link
Contributor Author

jayvdb commented Jul 15, 2020

This would also allow excluding routes which trigger assertion errors in drf-spectacular, such as #126

@tfranzel
Copy link
Owner

added preprocessing hooks support this functionality (example hook for excluding format).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants