openapi-parser icon indicating copy to clipboard operation
openapi-parser copied to clipboard

feat: allow to add description on struct fields using tag openapi-des…

Open denouche opened this issue 5 years ago • 2 comments

…cription

denouche avatar Sep 03 '20 14:09 denouche

cc @Sadzeih , what do you think about this?

denouche avatar Sep 03 '20 14:09 denouche

I love the idea of being able to add description and examples to fields. And we do have a need like that.

I don't know about implementation though. I think a comment would be a better way to do that, for readability but harder to implement.

Something like:

// @openapi:schema
type SomeStruct struct {
    // Name is the name of the SomeStruct
    // @openapi:example
    // test := SomeStruct{Name: "somestruct"}
    Name string `json:"name"`
}

I don't know if this is feasable, but I just don't really like the idea of multiple openapi StructField tags

Sadzeih avatar Sep 04 '20 10:09 Sadzeih