From 082c573ffb0cd3cc0fa69b34e6f6ee6f00d93541 Mon Sep 17 00:00:00 2001
From: Quaternions <krakow20@gmail.com>
Date: Tue, 1 Apr 2025 16:45:55 -0700
Subject: [PATCH] openapi: maps endpoints

---
 openapi.yaml | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 102 insertions(+), 1 deletion(-)

diff --git a/openapi.yaml b/openapi.yaml
index b7e8e0f..bb8bebc 100644
--- a/openapi.yaml
+++ b/openapi.yaml
@@ -8,8 +8,10 @@ servers:
 tags:
   - name: Mapfixes
     description: Mapfix operations
+  - name: Maps
+    description: Map queries
   - name: Session
-    description: Session operations
+    description: Session queries
   - name: Submissions
     description: Submission operations
   - name: Scripts
@@ -76,6 +78,73 @@ paths:
             application/json:
               schema:
                 $ref: "#/components/schemas/Error"
+  /maps:
+    get:
+      summary: Get list of maps
+      operationId: listMaps
+      tags:
+        - Maps
+      security: []
+      parameters:
+      - $ref: "#/components/parameters/Page"
+      - $ref: "#/components/parameters/Limit"
+      - name: DisplayName
+        in: query
+        schema:
+          type: string
+          maxLength: 128
+      - name: Creator
+        in: query
+        schema:
+          type: string
+          maxLength: 128
+      - name: GameID
+        in: query
+        schema:
+          type: integer
+          format: int32
+      - name: Sort
+        in: query
+        schema:
+          type: integer
+          format: int32
+      responses:
+        "200":
+          description: Successful response
+          content:
+            application/json:
+              schema:
+                type: array
+                items:
+                  $ref: "#/components/schemas/Map"
+        default:
+          description: General Error
+          content:
+            application/json:
+              schema:
+                $ref: "#/components/schemas/Error"
+  /maps/{MapID}:
+    get:
+      summary: Retrieve map with ID
+      operationId: getMap
+      tags:
+        - Maps
+      security: []
+      parameters:
+        - $ref: '#/components/parameters/MapID'
+      responses:
+        "200":
+          description: Successful response
+          content:
+            application/json:
+              schema:
+                $ref: "#/components/schemas/Map"
+        default:
+          description: General Error
+          content:
+            application/json:
+              schema:
+                $ref: "#/components/schemas/Error"
   /mapfixes:
     get:
       summary: Get list of mapfixes
@@ -948,6 +1017,14 @@ components:
       in: cookie
       name: session_id
   parameters:
+    MapID:
+      name: MapID
+      in: path
+      required: true
+      description: The unique identifier for a map.
+      schema:
+        type: integer
+        format: int64
     MapfixID:
       name: MapfixID
       in: path
@@ -1030,6 +1107,30 @@ components:
         AvatarURL:
           type: string
           maxLength: 256
+    Map:
+      required:
+      - ID
+      - DisplayName
+      - Creator
+      - GameID
+      - Date
+      type: object
+      properties:
+        ID:
+          type: integer
+          format: int64
+        DisplayName:
+          type: string
+          maxLength: 128
+        Creator:
+          type: string
+          maxLength: 128
+        GameID:
+          type: integer
+          format: int32
+        Date:
+          type: integer
+          format: int64
     Mapfix:
       required:
       - ID