Skip to content

Commit b7a8a63

Browse files
committed
Fix the way the openapi schema is parsed
1 parent 4a2c324 commit b7a8a63

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

src/api/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const commonParams = {
1616
target: "es2022", // Target ES2022
1717
sourcemap: false,
1818
platform: "node",
19-
external: ["aws-sdk", "moment-timezone", "passkit-generator", "fastify", "zod", "zod-openapi", "@fastify/swagger", "@fastify/swagger-ui"],
19+
external: ["aws-sdk", "moment-timezone", "passkit-generator", "fastify", "@fastify/swagger-ui"],
2020
alias: {
2121
'moment-timezone': resolve(process.cwd(), '../../node_modules/moment-timezone/builds/moment-timezone-with-data-10-year-range.js')
2222
},

src/api/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ async function init(prettyPrint: boolean = false) {
9595
});
9696
app.setValidatorCompiler(validatorCompiler);
9797
app.setSerializerCompiler(serializerCompiler);
98+
await app.register(fastifyZodOpenApiPlugin);
9899
await app.register(authorizeFromSchemaPlugin);
99100
await app.register(fastifyAuthPlugin);
100101
await app.register(FastifyAuthProvider);
101102
await app.register(errorHandlerPlugin);
102-
await app.register(fastifyZodOpenApiPlugin);
103103
await app.register(fastifySwagger, {
104104
openapi: {
105105
info: {

src/api/package.lambda.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
"moment-timezone": "^0.5.45",
1111
"passkit-generator": "^3.3.1",
1212
"fastify": "^5.3.2",
13-
"zod": "^3.23.8",
14-
"zod-openapi": "^4.2.4",
15-
"@fastify/swagger": "^9.5.0",
1613
"@fastify/swagger-ui": "^5.2.2"
1714
},
1815
"devDependencies": {}

src/api/routes/iam.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ const iamRoutes: FastifyPluginAsync = async (fastify, _options) => {
200200
{
201201
schema: withTags(["IAM"], {
202202
body: invitePostRequestSchema,
203-
response: { 202: entraActionResponseSchema },
203+
response: {
204+
202: { content: { "application/json": entraActionResponseSchema } },
205+
},
204206
}),
205207
onRequest: async (request, reply) => {
206208
await fastify.authorize(request, reply, [AppRoles.IAM_INVITE_ONLY]);
@@ -422,7 +424,11 @@ const iamRoutes: FastifyPluginAsync = async (fastify, _options) => {
422424
"/groups/:groupId",
423425
{
424426
schema: withTags(["IAM"], {
425-
// response: { 200: entraGroupMembershipListResponse },
427+
response: {
428+
200: {
429+
content: { "application/json": entraGroupMembershipListResponse },
430+
},
431+
},
426432
params: z.object({
427433
groupId,
428434
}),

0 commit comments

Comments
 (0)