mirror of
https://github.com/nprasad2077/NBA_Go.git
synced 2026-09-22 14:05:13 +00:00
swagger fixed
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
//go:build docs
|
||||
// +build docs
|
||||
|
||||
// Package docs Only contains Swagger annotations that are **global**.
|
||||
// Run `swag init --parseDependency --parseInternal` after editing.
|
||||
package docs
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// General API meta (kept here so CI can inject version/build).
|
||||
// ------------------------------------------------------------
|
||||
|
||||
// @title NBA_Go API
|
||||
// @version 1.0
|
||||
// @description Stats service with API‑key auth
|
||||
// @BasePath /
|
||||
// @schemes http https
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// 🔐 SECURITY – this block is what you asked for
|
||||
// ------------------------------------------------------------
|
||||
//
|
||||
// @securityDefinitions.apikey ApiKeyAuth
|
||||
// @in header
|
||||
// @name X-API-Key
|
||||
//
|
||||
// (every protected endpoint still needs `@Security ApiKeyAuth`)
|
||||
// ------------------------------------------------------------
|
||||
+12
-5
@@ -174,17 +174,24 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"securityDefinitions": {
|
||||
"ApiKeyAuth": {
|
||||
"type": "apiKey",
|
||||
"name": "X-API-Key",
|
||||
"in": "header"
|
||||
}
|
||||
}
|
||||
}`
|
||||
|
||||
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
||||
var SwaggerInfo = &swag.Spec{
|
||||
Version: "",
|
||||
Version: "1.0",
|
||||
Host: "",
|
||||
BasePath: "",
|
||||
Schemes: []string{},
|
||||
Title: "",
|
||||
Description: "",
|
||||
BasePath: "/",
|
||||
Schemes: []string{"http", "https"},
|
||||
Title: "NBA_Go API",
|
||||
Description: "Stats service with API-key auth",
|
||||
InfoInstanceName: "swagger",
|
||||
SwaggerTemplate: docTemplate,
|
||||
LeftDelim: "{{",
|
||||
|
||||
+16
-1
@@ -1,8 +1,16 @@
|
||||
{
|
||||
"schemes": [
|
||||
"http",
|
||||
"https"
|
||||
],
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"contact": {}
|
||||
"description": "Stats service with API-key auth",
|
||||
"title": "NBA_Go API",
|
||||
"contact": {},
|
||||
"version": "1.0"
|
||||
},
|
||||
"basePath": "/",
|
||||
"paths": {
|
||||
"/api/playeradvancedstats": {
|
||||
"get": {
|
||||
@@ -163,5 +171,12 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"securityDefinitions": {
|
||||
"ApiKeyAuth": {
|
||||
"type": "apiKey",
|
||||
"name": "X-API-Key",
|
||||
"in": "header"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
basePath: /
|
||||
info:
|
||||
contact: {}
|
||||
description: Stats service with API-key auth
|
||||
title: NBA_Go API
|
||||
version: "1.0"
|
||||
paths:
|
||||
/api/playeradvancedstats:
|
||||
get:
|
||||
@@ -105,4 +109,12 @@ paths:
|
||||
summary: Get player total stats
|
||||
tags:
|
||||
- PlayerTotals
|
||||
schemes:
|
||||
- http
|
||||
- https
|
||||
securityDefinitions:
|
||||
ApiKeyAuth:
|
||||
in: header
|
||||
name: X-API-Key
|
||||
type: apiKey
|
||||
swagger: "2.0"
|
||||
|
||||
Reference in New Issue
Block a user