From 82171fce7a6558f92c64830fddddc3a6839520e0 Mon Sep 17 00:00:00 2001 From: Jason Novinger Date: Mon, 24 Nov 2025 08:33:39 -0600 Subject: [PATCH] Fixes #20638: Document bulk create support in OpenAPI schema (#20777) * Fixes #20638: Document bulk create support in OpenAPI schema POST operations on NetBoxModelViewSet endpoints accept both single objects and arrays, but the schema only documented single objects. This prevented 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. * Address PR feedback - Removed brittle serializer marking mechanism in favor of direct checks on behavior. - Attempted to introduce a bulk_create action and then route to it on POST in NetBoxRouter, but ran in to several obstacles including breaking HTTP status code reporting in the schema. Opted to simply * Remove unused bulk_create_enabled attr Co-authored-by: Jeremy Stretch --------- Co-authored-by: Jeremy Stretch --- contrib/openapi.json | 2911 ++++++++++++++++++++-- netbox/core/api/schema.py | 36 + netbox/core/tests/test_openapi_schema.py | 108 + 3 files changed, 2808 insertions(+), 247 deletions(-) create mode 100644 netbox/core/tests/test_openapi_schema.py diff --git a/contrib/openapi.json b/contrib/openapi.json index 22690e679..25073dcb1 100644 --- a/contrib/openapi.json +++ b/contrib/openapi.json @@ -664,12 +664,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableCircuitGroupAssignmentRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableCircuitGroupAssignmentRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableCircuitGroupAssignmentRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableCircuitGroupAssignmentRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableCircuitGroupAssignmentRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableCircuitGroupAssignmentRequest" + } + } + ] } } }, @@ -1985,12 +2005,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CircuitGroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/CircuitGroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/CircuitGroupRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/CircuitGroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/CircuitGroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/CircuitGroupRequest" + } + } + ] } } }, @@ -3850,12 +3890,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CircuitTerminationRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/CircuitTerminationRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/CircuitTerminationRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/CircuitTerminationRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/CircuitTerminationRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/CircuitTerminationRequest" + } + } + ] } } }, @@ -5260,12 +5320,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CircuitTypeRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/CircuitTypeRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/CircuitTypeRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/CircuitTypeRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/CircuitTypeRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/CircuitTypeRequest" + } + } + ] } } }, @@ -7439,12 +7519,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableCircuitRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableCircuitRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableCircuitRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableCircuitRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableCircuitRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableCircuitRequest" + } + } + ] } } }, @@ -8786,12 +8886,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProviderAccountRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ProviderAccountRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProviderAccountRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ProviderAccountRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ProviderAccountRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProviderAccountRequest" + } + } + ] } } }, @@ -10057,12 +10177,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProviderNetworkRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ProviderNetworkRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProviderNetworkRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ProviderNetworkRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ProviderNetworkRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProviderNetworkRequest" + } + } + ] } } }, @@ -11558,12 +11698,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProviderRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ProviderRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProviderRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ProviderRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ProviderRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProviderRequest" + } + } + ] } } }, @@ -12822,12 +12982,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableVirtualCircuitTerminationRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableVirtualCircuitTerminationRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableVirtualCircuitTerminationRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableVirtualCircuitTerminationRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableVirtualCircuitTerminationRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableVirtualCircuitTerminationRequest" + } + } + ] } } }, @@ -14232,12 +14412,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/VirtualCircuitTypeRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/VirtualCircuitTypeRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/VirtualCircuitTypeRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/VirtualCircuitTypeRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/VirtualCircuitTypeRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/VirtualCircuitTypeRequest" + } + } + ] } } }, @@ -15749,12 +15949,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableVirtualCircuitRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableVirtualCircuitRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableVirtualCircuitRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableVirtualCircuitRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableVirtualCircuitRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableVirtualCircuitRequest" + } + } + ] } } }, @@ -18791,12 +19011,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableDataSourceRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableDataSourceRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableDataSourceRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableDataSourceRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableDataSourceRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableDataSourceRequest" + } + } + ] } } }, @@ -21830,12 +22070,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CableTerminationRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/CableTerminationRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/CableTerminationRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/CableTerminationRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/CableTerminationRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/CableTerminationRequest" + } + } + ] } } }, @@ -23871,12 +24131,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableCableRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableCableRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableCableRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableCableRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableCableRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableCableRequest" + } + } + ] } } } @@ -25163,12 +25443,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableConsolePortTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableConsolePortTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableConsolePortTemplateRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableConsolePortTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableConsolePortTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableConsolePortTemplateRequest" + } + } + ] } } }, @@ -27312,12 +27612,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableConsolePortRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableConsolePortRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableConsolePortRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableConsolePortRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableConsolePortRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableConsolePortRequest" + } + } + ] } } }, @@ -28594,12 +28914,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableConsoleServerPortTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableConsoleServerPortTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableConsoleServerPortTemplateRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableConsoleServerPortTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableConsoleServerPortTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableConsoleServerPortTemplateRequest" + } + } + ] } } }, @@ -30743,12 +31083,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableConsoleServerPortRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableConsoleServerPortRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableConsoleServerPortRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableConsoleServerPortRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableConsoleServerPortRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableConsoleServerPortRequest" + } + } + ] } } }, @@ -31980,12 +32340,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeviceBayTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/DeviceBayTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeviceBayTemplateRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/DeviceBayTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/DeviceBayTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeviceBayTemplateRequest" + } + } + ] } } }, @@ -33880,12 +34260,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeviceBayRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/DeviceBayRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeviceBayRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/DeviceBayRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/DeviceBayRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeviceBayRequest" + } + } + ] } } }, @@ -35387,12 +35787,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableDeviceRoleRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableDeviceRoleRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableDeviceRoleRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableDeviceRoleRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableDeviceRoleRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableDeviceRoleRequest" + } + } + ] } } }, @@ -38032,12 +38452,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableDeviceTypeRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableDeviceTypeRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableDeviceTypeRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableDeviceTypeRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableDeviceTypeRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableDeviceTypeRequest" + } + } + ] } } }, @@ -42075,12 +42515,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableDeviceWithConfigContextRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableDeviceWithConfigContextRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableDeviceWithConfigContextRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableDeviceWithConfigContextRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableDeviceWithConfigContextRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableDeviceWithConfigContextRequest" + } + } + ] } } }, @@ -43796,12 +44256,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableFrontPortTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableFrontPortTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableFrontPortTemplateRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableFrontPortTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableFrontPortTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableFrontPortTemplateRequest" + } + } + ] } } }, @@ -46154,12 +46634,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableFrontPortRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableFrontPortRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableFrontPortRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableFrontPortRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableFrontPortRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableFrontPortRequest" + } + } + ] } } }, @@ -48159,12 +48659,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableInterfaceTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableInterfaceTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableInterfaceTemplateRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableInterfaceTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableInterfaceTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableInterfaceTemplateRequest" + } + } + ] } } }, @@ -52646,12 +53166,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableInterfaceRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableInterfaceRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableInterfaceRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableInterfaceRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableInterfaceRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableInterfaceRequest" + } + } + ] } } }, @@ -54056,12 +54596,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InventoryItemRoleRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/InventoryItemRoleRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryItemRoleRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/InventoryItemRoleRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/InventoryItemRoleRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryItemRoleRequest" + } + } + ] } } }, @@ -55645,12 +56205,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InventoryItemTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/InventoryItemTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryItemTemplateRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/InventoryItemTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/InventoryItemTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryItemTemplateRequest" + } + } + ] } } }, @@ -58353,12 +58933,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableInventoryItemRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableInventoryItemRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableInventoryItemRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableInventoryItemRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableInventoryItemRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableInventoryItemRequest" + } + } + ] } } }, @@ -60314,12 +60914,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableLocationRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableLocationRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableLocationRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableLocationRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableLocationRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableLocationRequest" + } + } + ] } } }, @@ -61644,12 +62264,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MACAddressRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/MACAddressRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/MACAddressRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/MACAddressRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/MACAddressRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/MACAddressRequest" + } + } + ] } } }, @@ -62939,12 +63579,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ManufacturerRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ManufacturerRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ManufacturerRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ManufacturerRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ManufacturerRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ManufacturerRequest" + } + } + ] } } }, @@ -64317,12 +64977,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ModuleBayTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ModuleBayTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModuleBayTemplateRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ModuleBayTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ModuleBayTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModuleBayTemplateRequest" + } + } + ] } } }, @@ -66394,12 +67074,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ModuleBayRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ModuleBayRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModuleBayRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ModuleBayRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ModuleBayRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModuleBayRequest" + } + } + ] } } }, @@ -67462,12 +68162,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ModuleTypeProfileRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ModuleTypeProfileRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModuleTypeProfileRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ModuleTypeProfileRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ModuleTypeProfileRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModuleTypeProfileRequest" + } + } + ] } } }, @@ -68954,12 +69674,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableModuleTypeRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableModuleTypeRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableModuleTypeRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableModuleTypeRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableModuleTypeRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableModuleTypeRequest" + } + } + ] } } }, @@ -70770,12 +71510,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableModuleRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableModuleRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableModuleRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableModuleRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableModuleRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableModuleRequest" + } + } + ] } } }, @@ -72178,12 +72938,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritablePlatformRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritablePlatformRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritablePlatformRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritablePlatformRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritablePlatformRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritablePlatformRequest" + } + } + ] } } }, @@ -74160,12 +74940,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritablePowerFeedRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritablePowerFeedRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritablePowerFeedRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritablePowerFeedRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritablePowerFeedRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritablePowerFeedRequest" + } + } + ] } } }, @@ -75666,12 +76466,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritablePowerOutletTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritablePowerOutletTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritablePowerOutletTemplateRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritablePowerOutletTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritablePowerOutletTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritablePowerOutletTemplateRequest" + } + } + ] } } }, @@ -78324,12 +79144,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritablePowerOutletRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritablePowerOutletRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritablePowerOutletRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritablePowerOutletRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritablePowerOutletRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritablePowerOutletRequest" + } + } + ] } } }, @@ -79680,12 +80520,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PowerPanelRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/PowerPanelRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/PowerPanelRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/PowerPanelRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/PowerPanelRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/PowerPanelRequest" + } + } + ] } } }, @@ -81101,12 +81961,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritablePowerPortTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritablePowerPortTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritablePowerPortTemplateRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritablePowerPortTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritablePowerPortTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritablePowerPortTemplateRequest" + } + } + ] } } }, @@ -83400,12 +84280,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritablePowerPortRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritablePowerPortRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritablePowerPortRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritablePowerPortRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritablePowerPortRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritablePowerPortRequest" + } + } + ] } } }, @@ -84945,12 +85845,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableRackReservationRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableRackReservationRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableRackReservationRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableRackReservationRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableRackReservationRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableRackReservationRequest" + } + } + ] } } }, @@ -86315,12 +87235,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RackRoleRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/RackRoleRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/RackRoleRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/RackRoleRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/RackRoleRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/RackRoleRequest" + } + } + ] } } }, @@ -88634,12 +89574,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableRackTypeRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableRackTypeRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableRackTypeRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableRackTypeRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableRackTypeRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableRackTypeRequest" + } + } + ] } } }, @@ -91926,12 +92886,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableRackRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableRackRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableRackRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableRackRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableRackRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableRackRequest" + } + } + ] } } }, @@ -93701,12 +94681,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableRearPortTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableRearPortTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableRearPortTemplateRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableRearPortTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableRearPortTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableRearPortTemplateRequest" + } + } + ] } } }, @@ -96035,12 +97035,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableRearPortRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableRearPortRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableRearPortRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableRearPortRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableRearPortRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableRearPortRequest" + } + } + ] } } }, @@ -97472,12 +98492,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableRegionRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableRegionRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableRegionRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableRegionRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableRegionRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableRegionRequest" + } + } + ] } } }, @@ -98869,12 +99909,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableSiteGroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableSiteGroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableSiteGroupRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableSiteGroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableSiteGroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableSiteGroupRequest" + } + } + ] } } }, @@ -101048,12 +102108,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableSiteRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableSiteRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableSiteRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableSiteRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableSiteRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableSiteRequest" + } + } + ] } } }, @@ -102608,12 +103688,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableVirtualChassisRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableVirtualChassisRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableVirtualChassisRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableVirtualChassisRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableVirtualChassisRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableVirtualChassisRequest" + } + } + ] } } }, @@ -104216,12 +105316,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableVirtualDeviceContextRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableVirtualDeviceContextRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableVirtualDeviceContextRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableVirtualDeviceContextRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableVirtualDeviceContextRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableVirtualDeviceContextRequest" + } + } + ] } } }, @@ -104970,12 +106090,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BookmarkRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/BookmarkRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/BookmarkRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/BookmarkRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/BookmarkRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/BookmarkRequest" + } + } + ] } } }, @@ -106186,12 +107326,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConfigContextProfileRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ConfigContextProfileRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConfigContextProfileRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ConfigContextProfileRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ConfigContextProfileRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConfigContextProfileRequest" + } + } + ] } } }, @@ -108179,12 +109339,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConfigContextRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ConfigContextRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConfigContextRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ConfigContextRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ConfigContextRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConfigContextRequest" + } + } + ] } } }, @@ -109910,12 +111090,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConfigTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ConfigTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConfigTemplateRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ConfigTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ConfigTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConfigTemplateRequest" + } + } + ] } } }, @@ -111090,12 +112290,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableCustomFieldChoiceSetRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableCustomFieldChoiceSetRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableCustomFieldChoiceSetRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableCustomFieldChoiceSetRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableCustomFieldChoiceSetRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableCustomFieldChoiceSetRequest" + } + } + ] } } }, @@ -113377,12 +114597,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableCustomFieldRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableCustomFieldRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableCustomFieldRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableCustomFieldRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableCustomFieldRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableCustomFieldRequest" + } + } + ] } } }, @@ -114798,12 +116038,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CustomLinkRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/CustomLinkRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomLinkRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/CustomLinkRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/CustomLinkRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomLinkRequest" + } + } + ] } } }, @@ -116392,12 +117652,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableEventRuleRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableEventRuleRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableEventRuleRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableEventRuleRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableEventRuleRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableEventRuleRequest" + } + } + ] } } }, @@ -118128,12 +119408,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ExportTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ExportTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExportTemplateRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ExportTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ExportTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExportTemplateRequest" + } + } + ] } } }, @@ -119486,12 +120786,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageAttachmentRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ImageAttachmentRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageAttachmentRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ImageAttachmentRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ImageAttachmentRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageAttachmentRequest" + } + } + ] } } }, @@ -120517,12 +121837,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableJournalEntryRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableJournalEntryRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableJournalEntryRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableJournalEntryRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableJournalEntryRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableJournalEntryRequest" + } + } + ] } } }, @@ -120936,12 +122276,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationGroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/NotificationGroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationGroupRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/NotificationGroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/NotificationGroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationGroupRequest" + } + } + ] } } }, @@ -121355,12 +122715,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/NotificationRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/NotificationRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/NotificationRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationRequest" + } + } + ] } } }, @@ -123301,12 +124681,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedFilterRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/SavedFilterRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/SavedFilterRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/SavedFilterRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/SavedFilterRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/SavedFilterRequest" + } + } + ] } } }, @@ -124258,12 +125658,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SubscriptionRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/SubscriptionRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/SubscriptionRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/SubscriptionRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionRequest" + } + } + ] } } }, @@ -125627,12 +127047,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TableConfigRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/TableConfigRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/TableConfigRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/TableConfigRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/TableConfigRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/TableConfigRequest" + } + } + ] } } }, @@ -127458,12 +128898,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TagRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/TagRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/TagRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/TagRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/TagRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/TagRequest" + } + } + ] } } }, @@ -129161,12 +130621,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WebhookRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WebhookRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WebhookRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WebhookRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WebhookRequest" + } + } + ] } } }, @@ -130408,12 +131888,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableAggregateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableAggregateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableAggregateRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableAggregateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableAggregateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableAggregateRequest" + } + } + ] } } }, @@ -131951,12 +133451,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ASNRangeRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ASNRangeRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ASNRangeRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ASNRangeRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ASNRangeRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ASNRangeRequest" + } + } + ] } } }, @@ -133362,12 +134882,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ASNRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ASNRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ASNRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ASNRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ASNRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ASNRequest" + } + } + ] } } }, @@ -134332,12 +135872,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FHRPGroupAssignmentRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/FHRPGroupAssignmentRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/FHRPGroupAssignmentRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/FHRPGroupAssignmentRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/FHRPGroupAssignmentRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/FHRPGroupAssignmentRequest" + } + } + ] } } }, @@ -135998,12 +137558,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FHRPGroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/FHRPGroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/FHRPGroupRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/FHRPGroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/FHRPGroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/FHRPGroupRequest" + } + } + ] } } }, @@ -138083,12 +139663,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableIPAddressRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableIPAddressRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableIPAddressRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableIPAddressRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableIPAddressRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableIPAddressRequest" + } + } + ] } } }, @@ -139615,12 +141215,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableIPRangeRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableIPRangeRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableIPRangeRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableIPRangeRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableIPRangeRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableIPRangeRequest" + } + } + ] } } }, @@ -141811,12 +143431,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritablePrefixRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritablePrefixRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritablePrefixRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritablePrefixRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritablePrefixRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritablePrefixRequest" + } + } + ] } } }, @@ -143243,12 +144883,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RIRRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/RIRRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/RIRRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/RIRRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/RIRRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/RIRRequest" + } + } + ] } } }, @@ -144547,12 +146207,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RoleRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/RoleRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/RoleRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/RoleRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/RoleRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/RoleRequest" + } + } + ] } } }, @@ -145949,12 +147629,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RouteTargetRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/RouteTargetRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/RouteTargetRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/RouteTargetRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/RouteTargetRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/RouteTargetRequest" + } + } + ] } } }, @@ -147080,12 +148780,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableServiceTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableServiceTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableServiceTemplateRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableServiceTemplateRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableServiceTemplateRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableServiceTemplateRequest" + } + } + ] } } }, @@ -148513,12 +150233,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableServiceRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableServiceRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableServiceRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableServiceRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableServiceRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableServiceRequest" + } + } + ] } } }, @@ -149989,12 +151729,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/VLANGroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/VLANGroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/VLANGroupRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/VLANGroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/VLANGroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/VLANGroupRequest" + } + } + ] } } }, @@ -151160,12 +152920,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/VLANTranslationPolicyRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/VLANTranslationPolicyRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/VLANTranslationPolicyRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/VLANTranslationPolicyRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/VLANTranslationPolicyRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/VLANTranslationPolicyRequest" + } + } + ] } } }, @@ -152299,12 +154079,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/VLANTranslationRuleRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/VLANTranslationRuleRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/VLANTranslationRuleRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/VLANTranslationRuleRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/VLANTranslationRuleRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/VLANTranslationRuleRequest" + } + } + ] } } }, @@ -154400,12 +156200,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableVLANRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableVLANRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableVLANRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableVLANRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableVLANRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableVLANRequest" + } + } + ] } } }, @@ -155832,12 +157652,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/VRFRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/VRFRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/VRFRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/VRFRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/VRFRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/VRFRequest" + } + } + ] } } }, @@ -156969,12 +158809,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableContactAssignmentRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableContactAssignmentRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableContactAssignmentRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableContactAssignmentRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableContactAssignmentRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableContactAssignmentRequest" + } + } + ] } } }, @@ -158316,12 +160176,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableContactGroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableContactGroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableContactGroupRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableContactGroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableContactGroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableContactGroupRequest" + } + } + ] } } }, @@ -159535,12 +161415,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ContactRoleRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ContactRoleRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContactRoleRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ContactRoleRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ContactRoleRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContactRoleRequest" + } + } + ] } } }, @@ -161406,12 +163306,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ContactRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ContactRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContactRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ContactRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ContactRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContactRequest" + } + } + ] } } }, @@ -162727,12 +164647,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableTenantGroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableTenantGroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableTenantGroupRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableTenantGroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableTenantGroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableTenantGroupRequest" + } + } + ] } } }, @@ -164070,12 +166010,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TenantRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/TenantRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/TenantRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/TenantRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/TenantRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/TenantRequest" + } + } + ] } } }, @@ -164992,12 +166952,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/GroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroupRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/GroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/GroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroupRequest" + } + } + ] } } }, @@ -166077,12 +168057,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ObjectPermissionRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ObjectPermissionRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ObjectPermissionRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ObjectPermissionRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ObjectPermissionRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ObjectPermissionRequest" + } + } + ] } } }, @@ -167083,12 +169083,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TokenRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/TokenRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/TokenRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/TokenRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/TokenRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/TokenRequest" + } + } + ] } } }, @@ -168549,12 +170569,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/UserRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/UserRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/UserRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserRequest" + } + } + ] } } }, @@ -169844,12 +171884,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ClusterGroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ClusterGroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClusterGroupRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ClusterGroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ClusterGroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClusterGroupRequest" + } + } + ] } } }, @@ -171063,12 +173123,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ClusterTypeRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ClusterTypeRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClusterTypeRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ClusterTypeRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/ClusterTypeRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClusterTypeRequest" + } + } + ] } } }, @@ -172873,12 +174953,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableClusterRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableClusterRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableClusterRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableClusterRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableClusterRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableClusterRequest" + } + } + ] } } }, @@ -174757,12 +176857,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableVMInterfaceRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableVMInterfaceRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableVMInterfaceRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableVMInterfaceRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableVMInterfaceRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableVMInterfaceRequest" + } + } + ] } } }, @@ -175962,12 +178082,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/VirtualDiskRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/VirtualDiskRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/VirtualDiskRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/VirtualDiskRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/VirtualDiskRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/VirtualDiskRequest" + } + } + ] } } }, @@ -178699,12 +180839,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableVirtualMachineWithConfigContextRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableVirtualMachineWithConfigContextRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableVirtualMachineWithConfigContextRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableVirtualMachineWithConfigContextRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableVirtualMachineWithConfigContextRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableVirtualMachineWithConfigContextRequest" + } + } + ] } } }, @@ -180301,12 +182461,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableIKEPolicyRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableIKEPolicyRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableIKEPolicyRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableIKEPolicyRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableIKEPolicyRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableIKEPolicyRequest" + } + } + ] } } }, @@ -182175,12 +184355,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableIKEProposalRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableIKEProposalRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableIKEProposalRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableIKEProposalRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableIKEProposalRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableIKEProposalRequest" + } + } + ] } } }, @@ -183471,12 +185671,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableIPSecPolicyRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableIPSecPolicyRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableIPSecPolicyRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableIPSecPolicyRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableIPSecPolicyRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableIPSecPolicyRequest" + } + } + ] } } }, @@ -184806,12 +187026,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableIPSecProfileRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableIPSecProfileRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableIPSecProfileRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableIPSecProfileRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableIPSecProfileRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableIPSecProfileRequest" + } + } + ] } } }, @@ -186470,12 +188710,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableIPSecProposalRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableIPSecProposalRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableIPSecProposalRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableIPSecProposalRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableIPSecProposalRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableIPSecProposalRequest" + } + } + ] } } }, @@ -187755,12 +190015,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/L2VPNTerminationRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/L2VPNTerminationRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/L2VPNTerminationRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/L2VPNTerminationRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/L2VPNTerminationRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/L2VPNTerminationRequest" + } + } + ] } } }, @@ -189667,12 +191947,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableL2VPNRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableL2VPNRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableL2VPNRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableL2VPNRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableL2VPNRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableL2VPNRequest" + } + } + ] } } }, @@ -190962,12 +193262,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TunnelGroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/TunnelGroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunnelGroupRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/TunnelGroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/TunnelGroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunnelGroupRequest" + } + } + ] } } }, @@ -192172,12 +194492,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableTunnelTerminationRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableTunnelTerminationRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableTunnelTerminationRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableTunnelTerminationRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableTunnelTerminationRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableTunnelTerminationRequest" + } + } + ] } } }, @@ -193937,12 +196277,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableTunnelRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableTunnelRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableTunnelRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableTunnelRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableTunnelRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableTunnelRequest" + } + } + ] } } }, @@ -195254,12 +197614,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableWirelessLANGroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableWirelessLANGroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableWirelessLANGroupRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableWirelessLANGroupRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableWirelessLANGroupRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableWirelessLANGroupRequest" + } + } + ] } } }, @@ -197505,12 +199885,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableWirelessLANRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableWirelessLANRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableWirelessLANRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableWirelessLANRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableWirelessLANRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableWirelessLANRequest" + } + } + ] } } }, @@ -199512,12 +201912,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WritableWirelessLinkRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableWirelessLinkRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableWirelessLinkRequest" + } + } + ] } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/WritableWirelessLinkRequest" + "oneOf": [ + { + "$ref": "#/components/schemas/WritableWirelessLinkRequest" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/WritableWirelessLinkRequest" + } + } + ] } } }, @@ -229053,6 +231473,7 @@ }, "key": { "type": "string", + "writeOnly": true, "maxLength": 40, "minLength": 40 }, @@ -245296,11 +247717,6 @@ "format": "date-time", "nullable": true }, - "key": { - "type": "string", - "maxLength": 40, - "minLength": 40 - }, "write_enabled": { "type": "boolean", "description": "Permit create/update/delete operations using this key" @@ -245447,6 +247863,7 @@ }, "key": { "type": "string", + "writeOnly": true, "maxLength": 40, "minLength": 40 }, diff --git a/netbox/core/api/schema.py b/netbox/core/api/schema.py index c61675cf3..879712162 100644 --- a/netbox/core/api/schema.py +++ b/netbox/core/api/schema.py @@ -12,6 +12,7 @@ from drf_spectacular.utils import Direction from netbox.api.fields import ChoiceField from netbox.api.serializers import WritableNestedSerializer +from netbox.api.viewsets import NetBoxModelViewSet # see netbox.api.routers.NetBoxRouter BULK_ACTIONS = ("bulk_destroy", "bulk_partial_update", "bulk_update") @@ -49,6 +50,11 @@ class ChoiceFieldFix(OpenApiSerializerFieldExtension): ) +def viewset_handles_bulk_create(view): + """Check if view automatically provides list-based bulk create""" + return isinstance(view, NetBoxModelViewSet) + + class NetBoxAutoSchema(AutoSchema): """ Overrides to drf_spectacular.openapi.AutoSchema to fix following issues: @@ -128,6 +134,36 @@ class NetBoxAutoSchema(AutoSchema): return response_serializers + def _get_request_for_media_type(self, serializer, direction='request'): + """ + Override to generate oneOf schema for serializers that support both + single object and array input (NetBoxModelViewSet POST operations). + + Refs: #20638 + """ + # Get the standard schema first + schema, required = super()._get_request_for_media_type(serializer, direction) + + # If this serializer supports arrays (marked in get_request_serializer), + # wrap the schema in oneOf to allow single object OR array + if ( + direction == 'request' and + schema is not None and + getattr(self.view, 'action', None) == 'create' and + viewset_handles_bulk_create(self.view) + ): + return { + 'oneOf': [ + schema, # Single object + { + 'type': 'array', + 'items': schema, # Array of objects + } + ] + }, required + + return schema, required + def _get_serializer_name(self, serializer, direction, bypass_extensions=False) -> str: name = super()._get_serializer_name(serializer, direction, bypass_extensions) diff --git a/netbox/core/tests/test_openapi_schema.py b/netbox/core/tests/test_openapi_schema.py new file mode 100644 index 000000000..7fbe5662a --- /dev/null +++ b/netbox/core/tests/test_openapi_schema.py @@ -0,0 +1,108 @@ +""" +Unit tests for OpenAPI schema generation. + +Refs: #20638 +""" +import json +from django.test import TestCase + + +class OpenAPISchemaTestCase(TestCase): + """Tests for OpenAPI schema generation.""" + + def setUp(self): + """Fetch schema via API endpoint.""" + response = self.client.get('/api/schema/', {'format': 'json'}) + self.assertEqual(response.status_code, 200) + self.schema = json.loads(response.content) + + def test_post_operation_documents_single_or_array(self): + """ + POST operations on NetBoxModelViewSet endpoints should document + support for both single objects and arrays via oneOf. + + Refs: #20638 + """ + # Test representative endpoints across different apps + test_paths = [ + '/api/core/data-sources/', + '/api/dcim/sites/', + '/api/users/users/', + '/api/ipam/ip-addresses/', + ] + + for path in test_paths: + with self.subTest(path=path): + operation = self.schema['paths'][path]['post'] + + # Get the request body schema + request_schema = operation['requestBody']['content']['application/json']['schema'] + + # Should have oneOf with two options + self.assertIn('oneOf', request_schema, f"POST {path} should have oneOf schema") + self.assertEqual( + len(request_schema['oneOf']), 2, + f"POST {path} oneOf should have exactly 2 options" + ) + + # First option: single object (has $ref or properties) + single_schema = request_schema['oneOf'][0] + self.assertTrue( + '$ref' in single_schema or 'properties' in single_schema, + f"POST {path} first oneOf option should be single object" + ) + + # Second option: array of objects + array_schema = request_schema['oneOf'][1] + self.assertEqual( + array_schema['type'], 'array', + f"POST {path} second oneOf option should be array" + ) + self.assertIn('items', array_schema, f"POST {path} array should have items") + + def test_bulk_update_operations_require_array_only(self): + """ + Bulk update/patch operations should require arrays only, not oneOf. + They don't support single object input. + + Refs: #20638 + """ + test_paths = [ + '/api/dcim/sites/', + '/api/users/users/', + ] + + for path in test_paths: + for method in ['put', 'patch']: + with self.subTest(path=path, method=method): + operation = self.schema['paths'][path][method] + request_schema = operation['requestBody']['content']['application/json']['schema'] + + # Should be array-only, not oneOf + self.assertNotIn( + 'oneOf', request_schema, + f"{method.upper()} {path} should NOT have oneOf (array-only)" + ) + self.assertEqual( + request_schema['type'], 'array', + f"{method.upper()} {path} should require array" + ) + self.assertIn( + 'items', request_schema, + f"{method.upper()} {path} array should have items" + ) + + def test_bulk_delete_requires_array(self): + """ + Bulk delete operations should require arrays. + + Refs: #20638 + """ + path = '/api/dcim/sites/' + operation = self.schema['paths'][path]['delete'] + request_schema = operation['requestBody']['content']['application/json']['schema'] + + # Should be array-only + self.assertNotIn('oneOf', request_schema, "DELETE should NOT have oneOf") + self.assertEqual(request_schema['type'], 'array', "DELETE should require array") + self.assertIn('items', request_schema, "DELETE array should have items")