feat(docs): Swagger generation

This commit is contained in:
2024-12-02 17:13:05 +01:00
parent 3f35d35016
commit 491d31e2e9
7 changed files with 189 additions and 7 deletions

53
docs/docs.go Normal file
View File

@@ -0,0 +1,53 @@
// 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": {
"/contracts": {
"post": {
"description": "Generate a contract based on the provided data",
"consumes": [
"application/json"
],
"produces": [
"application/pdf"
],
"tags": [
"contracts"
],
"summary": "Generate a contract",
"responses": {}
}
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "",
Host: "",
BasePath: "",
Schemes: []string{},
Title: "LfK Document Server API",
Description: "This is the API documentation for the LfK Document Server - a tool for pdf generation.",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}

26
docs/swagger.json Normal file
View File

@@ -0,0 +1,26 @@
{
"swagger": "2.0",
"info": {
"description": "This is the API documentation for the LfK Document Server - a tool for pdf generation.",
"title": "LfK Document Server API",
"contact": {}
},
"paths": {
"/contracts": {
"post": {
"description": "Generate a contract based on the provided data",
"consumes": [
"application/json"
],
"produces": [
"application/pdf"
],
"tags": [
"contracts"
],
"summary": "Generate a contract",
"responses": {}
}
}
}
}

18
docs/swagger.yaml Normal file
View File

@@ -0,0 +1,18 @@
info:
contact: {}
description: This is the API documentation for the LfK Document Server - a tool
for pdf generation.
title: LfK Document Server API
paths:
/contracts:
post:
consumes:
- application/json
description: Generate a contract based on the provided data
produces:
- application/pdf
responses: {}
summary: Generate a contract
tags:
- contracts
swagger: "2.0"