@@ -39,13 +39,10 @@ import {
3939 FastifyPluginAsyncZodOpenApi ,
4040 FastifyZodOpenApiSchema ,
4141 FastifyZodOpenApiTypeProvider ,
42- serializerCompiler ,
43- validatorCompiler ,
4442} from "fastify-zod-openapi" ;
4543import { ts , withRoles , withTags } from "api/components/index.js" ;
46- import { MAX_METADATA_KEYS , metadataSchema } from "common/types/events.js" ;
44+ import { metadataSchema } from "common/types/events.js" ;
4745import { evaluateAllRequestPolicies } from "api/plugins/evaluatePolicies.js" ;
48- import { request } from "http" ;
4946
5047const createProjectionParams = ( includeMetadata : boolean = false ) => {
5148 // Object mapping attribute names to their expression aliases
@@ -97,12 +94,27 @@ export type EventRepeatOptions = (typeof repeatOptions)[number];
9794const baseSchema = z . object ( {
9895 title : z . string ( ) . min ( 1 ) ,
9996 description : z . string ( ) . min ( 1 ) ,
100- start : z . string ( ) ,
101- end : z . optional ( z . string ( ) ) ,
102- location : z . string ( ) ,
103- locationLink : z . optional ( z . string ( ) . url ( ) ) ,
97+ start : z . string ( ) . openapi ( {
98+ description : "Timestamp in the America/Chicago timezone." ,
99+ example : "2024-08-27T19:00:00" ,
100+ } ) ,
101+ end : z . optional ( z . string ( ) ) . openapi ( {
102+ description : "Timestamp in the America/Chicago timezone." ,
103+ example : "2024-08-27T20:00:00" ,
104+ } ) ,
105+ location : z . string ( ) . openapi ( {
106+ description : "Human-friendly location name." ,
107+ example : "Siebel Center for Computer Science" ,
108+ } ) ,
109+ locationLink : z . optional ( z . string ( ) . url ( ) ) . openapi ( {
110+ description : "Google Maps link for easy navigation to the event location." ,
111+ example : "https://maps.app.goo.gl/dwbBBBkfjkgj8gvA8" ,
112+ } ) ,
104113 host : z . enum ( OrganizationList as [ string , ...string [ ] ] ) ,
105- featured : z . boolean ( ) . default ( false ) ,
114+ featured : z . boolean ( ) . default ( false ) . openapi ( {
115+ description :
116+ "Whether or not the event should be shown on the ACM @ UIUC website home page (and added to Discord, as available)." ,
117+ } ) ,
106118 paidEventId : z . optional ( z . string ( ) . min ( 1 ) ) ,
107119 metadata : metadataSchema ,
108120} ) ;
0 commit comments