Fixes #20638: Document bulk create support in OpenAPI schema #895

Closed
opened 2026-04-05 18:35:58 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @jnovinger on 11/10/2025

Fixes: #20638

POST operations on NetBoxModelViewSet endpoints accept both single objects and arrays, but the schema only documented single objects. This prevented REST API client generators from producing correct code.

Add explicit bulk_create_enabled flag to NetBoxModelViewSet and update schema generation to emit oneOf for these endpoints.

FWIW, I don't believe the PUT issue reported is a bug. The schema seems to correctly document PUT as array-only. NetBox's PUT is a bulk operation by design. For single updates, use PATCH /api/model/{id}/.

*Originally created by @jnovinger on 11/10/2025* ### Fixes: #20638 POST operations on `NetBoxModelViewSet` endpoints accept both single objects and arrays, but the schema only documented single objects. This prevented REST API client generators from producing correct code. Add explicit bulk_create_enabled flag to `NetBoxModelViewSet` and update schema generation to emit `oneOf` for these endpoints. FWIW, I don't believe the `PUT` issue reported is a bug. The schema seems to correctly document `PUT` as array-only. NetBox's PUT is a bulk operation by design. For single updates, use `PATCH /api/model/{id}/`.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#895