Skip to content

Embedded Structs #132

Answered by vearutop
tushardas asked this question in Q&A
Nov 27, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

openapi-go operates using reflection only, so the comments are not available as a source of information.

This should probably give the expected result:

type Dept struct {
	Number int `json:"no" example:"123" description:"Unique identifier of Department"`
	Name string `json:"name" example:"BCCI" description:"Name of the Department"`
}

Here is documentation about means of spec control: https://github.com/swaggest/jsonschema-go#field-tags.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tushardas
Comment options

Answer selected by tushardas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants