In my golang project, I have a structure that contains this field:
type hook struct {
Data interface{} `json:"data"`
}
How to represent this Data field in Open API Spec?
In my golang project, I have a structure that contains this field:
type hook struct {
Data interface{} `json:"data"`
}
How to represent this Data field in Open API Spec?
Copyright © 2021 Jogjafile Inc.
It is not a good idea to use the absolutely free form type in the specification, I think, but if you want to do so, use the
{}form of definition:Also you can add a
nullvalue to the allowed:See the "Any Type" section of the types documentation: https://swagger.io/docs/specification/data-models/data-types/