Files
goapi/docs/swagger.json
2025-10-08 11:21:44 -06:00

96 lines
2.7 KiB
JSON

{
"swagger": "2.0",
"info": {
"description": "A basic API with support for Swagger and Middleware",
"title": "GoApi",
"contact": {},
"version": "1.0"
},
"host": "localhost:8080",
"basePath": "/api/v1",
"paths": {
"/health": {
"get": {
"description": "Check if the API is running",
"produces": [
"application/json"
],
"tags": [
"health"
],
"summary": "Health check",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/users": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Get list of all users",
"produces": [
"application/json"
],
"tags": [
"users"
],
"summary": "Get users",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/main.User"
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
},
"definitions": {
"main.User": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
}
}
},
"securityDefinitions": {
"ApiKeyAuth": {
"type": "apiKey",
"name": "X-API-Key",
"in": "header"
}
}
}