swag icon indicating copy to clipboard operation
swag copied to clipboard

A way to explicitly include a struct into a definition

Open philous opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. Is there a way to include a struct into a definition even if it is not mentioned in any controller description? I have an interface{} property in a model, and I would like to include a number of specific structs into a definition for that property, so they can be used from a client side afterwards.

Describe the solution you'd like Something similat to https://goswagger.io/use/spec/model.html maybe.

Describe alternatives you've considered An alternative would ne to add them manually but this is hard when the amount of models is large.

philous avatar Dec 15 '22 15:12 philous

Also need a way to indicate the relation between the definition and the struct field

sdghchj avatar Dec 29 '22 01:12 sdghchj

Also need a way to indicate the relation between the definition and the struct field

I think one possible way is to mention those structs in comments of places where they may be used.

liweitianux avatar Jun 29 '23 02:06 liweitianux