Skip to content

Comments

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

Open
denouche wants to merge 1 commit intomasterfrom
feat/description
Open

feat: allow to add description on struct fields using tag openapi-des…#36
denouche wants to merge 1 commit intomasterfrom
feat/description

Conversation

@denouche
Copy link
Collaborator

@denouche denouche commented Sep 3, 2020

…cription

@denouche denouche self-assigned this Sep 3, 2020
@denouche denouche force-pushed the feat/description branch 4 times, most recently from 3c9527a to 015d2d6 Compare September 3, 2020 14:37
@denouche
Copy link
Collaborator Author

denouche commented Sep 3, 2020

cc @Sadzeih , what do you think about this?

@Sadzeih
Copy link

Sadzeih commented Sep 4, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants