maps-service/openapi.yaml
2024-11-25 21:18:11 -08:00

172 lines
3.7 KiB
YAML

openapi: 3.1.0
info:
title: StrafesNET Maptest - OpenAPI 3.1
description: Browse and manage maps in the staging pipeline.
version: 0.1.0
servers:
- url: https://maptest.strafes.net/v1
tags:
- name: Maps
description: Map operations
paths:
# create
# status
# submit
# accept
# publish
# complete
/maps:
get:
summary: Get list of submissions
operationId: listMaps
tags:
- Maps
parameters:
- name: page
in: query
required: true
schema:
$ref: "#/components/schemas/Pagination"
- name: filter
in: query
required: false
schema:
$ref: "#/components/schemas/MapFilter"
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"
post:
summary: Create new submission
operationId: createMap
tags:
- Maps
parameters:
- name: map
in: query
required: true
schema:
$ref: "#/components/schemas/MapCreate"
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"
/maps/{MapID}:
get:
summary: Retrieve map with ID
operationId: getMap
tags:
- Maps
parameters:
- name: MapID
in: path
required: true
schema:
type: integer
format: int64
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"
components:
schemas:
User:
type: object
properties:
ID:
type: integer
format: int64
Username:
type: string
StateID:
type: integer
format: int32
Map:
type: object
properties:
ID:
type: integer
format: int64
DisplayName:
type: string
Creator:
type: string
GameID:
type: integer
format: int32
Date:
type: integer
format: int64
MapFilter:
type: object
properties:
ID:
type: integer
format: int64
DisplayName:
type: string
Creator:
type: string
GameID:
type: integer
format: int32
Date:
type: integer
format: int64
Pagination:
type: object
required:
- Page
- Limit
properties:
Page:
type: integer
format: int32
minimum: 1
Limit:
type: integer
format: int32
minimum: 1
maximum: 100
Error:
description: Represents error object
type: object
properties:
code:
type: integer
format: int64
message:
type: string
required:
- code
- message