Arthur 1 giorno fa
parent
commit
fbd74d3b2c
2 ha cambiato i file con 1 aggiunte e 5 eliminazioni
  1. 0 5
      netbox/extras/api/urls.py
  2. 1 0
      netbox/extras/api/views.py

+ 0 - 5
netbox/extras/api/urls.py

@@ -27,11 +27,6 @@ router.register('config-context-profiles', views.ConfigContextProfileViewSet)
 router.register('config-templates', views.ConfigTemplateViewSet)
 router.register('scripts', views.ScriptViewSet, basename='script')
 
-# Map POST to the script detail route for running scripts (without affecting the list route)
-for route in router.routes:
-    if route.name == '{basename}-detail':
-        route.mapping['post'] = 'post'
-
 app_name = 'extras-api'
 urlpatterns = [
     path('dashboard/', views.DashboardView.as_view(), name='dashboard'),

+ 1 - 0
netbox/extras/api/views.py

@@ -264,6 +264,7 @@ class ConfigTemplateViewSet(SyncedDataMixin, ConfigTemplateRenderMixin, NetBoxMo
 #
 
 @extend_schema_view(
+    create=extend_schema(exclude=True),  # Hide POST from list endpoint in Swagger
     update=extend_schema(request=serializers.ScriptInputSerializer),
     partial_update=extend_schema(request=serializers.ScriptInputSerializer),
 )