From 38b620e4a2d51da5382c12296804f59bc863452c Mon Sep 17 00:00:00 2001 From: thegagne <1399002+thegagne@users.noreply.github.com> Date: Tue, 24 Mar 2026 19:58:54 -0500 Subject: [PATCH] fix(openapi): correct Create/Apply HTTP response codes Create (POST) must return 201 Created per RFC 7231. Apply (PUT) must return 201 when creating a resource and 200 when updating. --- pkg/api/openapi.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/api/openapi.go b/pkg/api/openapi.go index 165a33c..4923426 100644 --- a/pkg/api/openapi.go +++ b/pkg/api/openapi.go @@ -185,7 +185,7 @@ func ConvertToOpenAPI(api *API) (*openapi.OpenAPI, error) { Parameters: params, RequestBody: &bodyParam, Responses: map[string]openapi.Response{ - "200": resourceResponse, + "201": resourceResponse, }, } if r.Methods.Create.IsLongRunning { @@ -326,6 +326,7 @@ func ConvertToOpenAPI(api *API) (*openapi.OpenAPI, error) { RequestBody: &bodyParam, Responses: map[string]openapi.Response{ "200": resourceResponse, + "201": resourceResponse, }, } if r.Methods.Apply.IsLongRunning {