-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix definition of vid_ranges
in VLANGroup
so it shows up in the OpenAPI schema
#18237
base: main
Are you sure you want to change the base?
Fix definition of vid_ranges
in VLANGroup
so it shows up in the OpenAPI schema
#18237
Conversation
vid_ranges
in VLANGroup
so it shows up
vid_ranges
in VLANGroup
so it shows upvid_ranges
in VLANGroup
so it shows up in the OpenAPI schema
yeah i saw. i think this is likely a little bit more complex and i wanted to get this bug fix out quickly so people can use the API again. I can look into improving this in another PR, if you're ok with that? |
This PR has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further action is taken. |
@jeremystretch i changed the implementation to use a schema extension instead of an annotation, as recommended by the spectacular devs. I don't think using |
@mraerino Can you please rebase this to main |
4d794da
to
bd8be38
Compare
done! |
Fixes: #17488
The OpenAPI schema for
vid_ranges
cannot automatically be discovered by drf-spectacular since it's a custom serializer with no fields. Therefore we need to manually provide the OpenAPI schema for the type we expect to see in requests and responses.On top of that there is a bug in drf-spectacular that required the workaround with the custom list class (tfranzel/drf-spectacular#1353).