@@ 0,0 1,98 @@
+const serverySchema = {
+ type: 'string',
+ enum: ['west-servery', 'seibel-servery', 'baker-kitchen', 'north-servery'],
+};
+
+const menuSchema = {
+ type: 'array',
+ items: {
+ type: 'object',
+ properties: {
+ item: { type: 'string', example: 'Fiesta Rice' },
+ tags: { type: 'array', items: { type: 'string', example: 'vegan' } },
+ },
+ },
+};
+
+const docs = {
+ openapi: '3.0.0',
+ info: {
+ title: 'Rice Dining API',
+ version: '0.1.0',
+ },
+ servers: [
+ { url: 'https://dining.rice.edu.bzin.ga' },
+ ],
+ paths: {
+ '/{servery}': {
+ get: {
+ summary: 'Get the current daily menu',
+ parameters: [
+ {
+ name: 'servery',
+ in: 'path',
+ required: true,
+ schema: serverySchema,
+ },
+ ],
+ responses: {
+ '200': {
+ description: 'OK',
+ content: {
+ 'application/json': {
+ schema: {
+ type: 'array',
+ items: {
+ type: 'object',
+ properties: {
+ meal: { type: 'string', example: 'Lunch' },
+ menu: menuSchema,
+ },
+ },
+ },
+ },
+ },
+ },
+ '404': { description: 'Not found' },
+ '500': { description: 'Unexpected error' },
+ },
+ },
+ },
+ '/{servery}/full-week-menu': {
+ get: {
+ summary: 'Get the current weekly menu',
+ parameters: [
+ {
+ name: 'servery',
+ in: 'path',
+ required: true,
+ schema: serverySchema,
+ },
+ ],
+ responses: {
+ '200': {
+ description: 'OK',
+ content: {
+ 'application/json': {
+ schema: {
+ type: 'array',
+ items: {
+ type: 'object',
+ properties: {
+ meal: { type: 'string', example: 'Monday Lunch' },
+ menu: menuSchema,
+ },
+ },
+ },
+ },
+ },
+ },
+ '404': { description: 'Not found' },
+ '500': { description: 'Unexpected error' },
+ },
+ },
+ },
+ },
+};
+
+export default docs;