command
Version:
v0.0.0-...-9b5cd94
Opens a new window with list of versions in this module.
Published: Apr 5, 2024
License: AGPL-3.0
Opens a new window with license information.
Imports: 12
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Deployment
Use configuration dir. Provide the path to the config through -c
argument.
Use -port
to change API port.
Use -d
to enable debug mode.
Use -docs
to enable Open API documentation on /swagger
endpoint.
Documentation
How to add new endpoint to Open API documentation:
-
For POST
and PUT
requests add a model to a handler comment.
// @Param request body CreateRequest true "request"
func (a *api) Create(c *gin.Context) {
}
-
Add new response model to a handler comment.
// @Success 201 {object} Rule
func (a *api) Create(c *gin.Context) {
}
-
Generate Open API schemas documentation for Golang structs using go:generate
in main.go.
-
Use generated schemas in Open API v3 documentation.
paths:
/rules:
post:
requestBody:
required: true
content:
application/json:
schema:
$ref: 'schemas_swagger.yaml#/definitions/rule.CreateRequest'
responses:
201:
content:
application/json:
schema:
$ref: 'schemas_swagger.yaml#/definitions/rule.Rule'
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.