swagger docs

This commit is contained in:
Ravi Prasad
2025-04-30 21:36:44 -05:00
parent e269bc5145
commit 80e4823b35
7 changed files with 438 additions and 8 deletions
+107
View File
@@ -0,0 +1,107 @@
// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"contact": {},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/api/playerstats": {
"get": {
"description": "Returns filtered and paginated player stats",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"PlayerStats"
],
"summary": "Get player stats",
"parameters": [
{
"type": "integer",
"description": "Season (e.g., 2025)",
"name": "season",
"in": "query"
},
{
"type": "string",
"description": "Team abbreviation (e.g., MIL)",
"name": "team",
"in": "query"
},
{
"type": "string",
"description": "Player ID (e.g., greenaj01)",
"name": "playerId",
"in": "query"
},
{
"type": "integer",
"default": 1,
"description": "Page number",
"name": "page",
"in": "query"
},
{
"type": "integer",
"default": 20,
"description": "Page size",
"name": "pageSize",
"in": "query"
},
{
"type": "string",
"description": "Field to sort by (e.g., per, games, winShares)",
"name": "sortBy",
"in": "query"
},
{
"type": "boolean",
"description": "Sort ascending (default false)",
"name": "ascending",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "",
Host: "",
BasePath: "",
Schemes: []string{},
Title: "",
Description: "",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}
+78
View File
@@ -0,0 +1,78 @@
{
"swagger": "2.0",
"info": {
"contact": {}
},
"paths": {
"/api/playerstats": {
"get": {
"description": "Returns filtered and paginated player stats",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"PlayerStats"
],
"summary": "Get player stats",
"parameters": [
{
"type": "integer",
"description": "Season (e.g., 2025)",
"name": "season",
"in": "query"
},
{
"type": "string",
"description": "Team abbreviation (e.g., MIL)",
"name": "team",
"in": "query"
},
{
"type": "string",
"description": "Player ID (e.g., greenaj01)",
"name": "playerId",
"in": "query"
},
{
"type": "integer",
"default": 1,
"description": "Page number",
"name": "page",
"in": "query"
},
{
"type": "integer",
"default": 20,
"description": "Page size",
"name": "pageSize",
"in": "query"
},
{
"type": "string",
"description": "Field to sort by (e.g., per, games, winShares)",
"name": "sortBy",
"in": "query"
},
{
"type": "boolean",
"description": "Sort ascending (default false)",
"name": "ascending",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
+51
View File
@@ -0,0 +1,51 @@
info:
contact: {}
paths:
/api/playerstats:
get:
consumes:
- application/json
description: Returns filtered and paginated player stats
parameters:
- description: Season (e.g., 2025)
in: query
name: season
type: integer
- description: Team abbreviation (e.g., MIL)
in: query
name: team
type: string
- description: Player ID (e.g., greenaj01)
in: query
name: playerId
type: string
- default: 1
description: Page number
in: query
name: page
type: integer
- default: 20
description: Page size
in: query
name: pageSize
type: integer
- description: Field to sort by (e.g., per, games, winShares)
in: query
name: sortBy
type: string
- description: Sort ascending (default false)
in: query
name: ascending
type: boolean
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
summary: Get player stats
tags:
- PlayerStats
swagger: "2.0"