I'm doing a golang API and need to documentate it. So I'm using swaggo
This a example struct like mine's:
type calc struct {
ID int64 `json:"id"`
Value1 int64 `json:"value1"`
Value2 int64 `json:"value2"`
Result int64 `json:"result"`
}
Pretend I have two routes:
- Get all calcs (a list)
- Do a calc
Whem doing the docs I specify that the 'Do a calc' route get a json object like calc.
The problem is: I'm using this struct to 'read' and 'write', so whem I documentate in the 'Do a calc' route, it means that I need a 'json calc obejct', but I don't know how to omit the ID and RESULT fields from the specification (I don't need use this fields on this route, of course).