You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -57,6 +101,11 @@ export function withRoles<T extends FastifyZodOpenApiSchema>(
57
101
if(!disableApiKeyAuth){
58
102
security.push({apiKeyAuth: []});
59
103
}
104
+
constresponses={
105
+
401: notAuthorizedError,
106
+
403: notAuthenticatedError,
107
+
...schema.response,
108
+
};
60
109
return{
61
110
security,
62
111
"x-required-roles": roles,
@@ -66,5 +115,22 @@ export function withRoles<T extends FastifyZodOpenApiSchema>(
66
115
? `${disableApiKeyAuth ? "API key authentication is not permitted for this route.\n\n" : ""}Requires one of the following roles: ${roles.join(", ")}.${schema.description ? `\n\n${schema.description}` : ""}`
67
116
: "Requires valid authentication but no specific role.",
0 commit comments