Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support swagger type format for global override #1852

Open
Yavith opened this issue Jul 25, 2024 · 1 comment
Open

Support swagger type format for global override #1852

Yavith opened this issue Jul 25, 2024 · 1 comment

Comments

@Yavith
Copy link

Yavith commented Jul 25, 2024

Is your feature request related to a problem? Please describe.
I am trying to declare a global override in .swaggo to replace my custom date struct with the string swagger type using the date-time format

Describe the solution you'd like
The solution I would be along the lines of an additional formatting parameter after the type in the 'replace' function e.g.

replace src/types.NullTime string date-time

Describe alternatives you've considered
One workaround I've explored is to replace this type with another custom type with the correct swagger format:

type NullTimeSwagger struct {
	String *string `swaggertype:"string" format:"date-time"`
}

However, the generated doc places the date-time string inside a struct, which is undesirable.

@serious-snow
Copy link

hope same

type SFID int64

type GreeterReq struct {
	ID SFID `json:"id"`
}

The result I want is type:string, format: int64
I don't want to label every field that uses SFID, but I want to rewrite it through the interface, or--overrides Fileld

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

No branches or pull requests

2 participants