Unify put vs post

This commit is contained in:
Owen
2026-07-16 15:33:43 -04:00
parent f1ed4da8a4
commit 2bc6b28978
9 changed files with 417 additions and 13 deletions
@@ -43,7 +43,7 @@ const setResourcePolicyRulesParamsSchema = z.strictObject({
});
registry.registerPath({
method: "put",
method: "post",
path: "/resource-policy/{resourcePolicyId}/rules",
description:
"Set all rules for a resource policy at once. This will replace all existing rules.",
@@ -62,7 +62,7 @@ registry.registerPath({
});
registry.registerPath({
method: "put",
method: "post",
path: "/public-resource-policy/{resourcePolicyId}/rules",
description:
"Set all rules for a resource policy at once. This will replace all existing rules.",
@@ -80,6 +80,46 @@ registry.registerPath({
responses: {}
});
registry.registerPath({
method: "put",
path: "/resource-policy/{resourcePolicyId}/rules",
description:
"Set all rules for a resource policy at once. This will replace all existing rules. Deprecated: use POST instead.",
deprecated: true,
tags: [OpenAPITags.PublicResourcePolicyLegacy],
request: {
params: setResourcePolicyRulesParamsSchema,
body: {
content: {
"application/json": {
schema: setResourcePolicyRulesBodySchema
}
}
}
},
responses: {}
});
registry.registerPath({
method: "put",
path: "/public-resource-policy/{resourcePolicyId}/rules",
description:
"Set all rules for a resource policy at once. This will replace all existing rules. Deprecated: use POST instead.",
deprecated: true,
tags: [OpenAPITags.PublicResourcePolicy],
request: {
params: setResourcePolicyRulesParamsSchema,
body: {
content: {
"application/json": {
schema: setResourcePolicyRulesBodySchema
}
}
}
},
responses: {}
});
export async function setResourcePolicyRules(
req: Request,
res: Response,