mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Sort types before processing for openapi-gen
This commit is contained in:
parent
6d9e2afeda
commit
8dc91dc0f7
@ -69,17 +69,26 @@ func hasOptionalTag(m *types.Member) bool {
|
|||||||
return hasOptionalCommentTag || hasOptionalJsonTag
|
return hasOptionalCommentTag || hasOptionalJsonTag
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type identityNamer struct{}
|
||||||
|
|
||||||
|
func (_ identityNamer) Name(t *types.Type) string {
|
||||||
|
return t.Name.String()
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ namer.Namer = identityNamer{}
|
||||||
|
|
||||||
// NameSystems returns the name system used by the generators in this package.
|
// NameSystems returns the name system used by the generators in this package.
|
||||||
func NameSystems() namer.NameSystems {
|
func NameSystems() namer.NameSystems {
|
||||||
return namer.NameSystems{
|
return namer.NameSystems{
|
||||||
"raw": namer.NewRawNamer("", nil),
|
"raw": namer.NewRawNamer("", nil),
|
||||||
|
"sorting_namer": identityNamer{},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DefaultNameSystem returns the default name system for ordering the types to be
|
// DefaultNameSystem returns the default name system for ordering the types to be
|
||||||
// processed by the generators in this package.
|
// processed by the generators in this package.
|
||||||
func DefaultNameSystem() string {
|
func DefaultNameSystem() string {
|
||||||
return "raw"
|
return "sorting_namer"
|
||||||
}
|
}
|
||||||
|
|
||||||
func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages {
|
func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages {
|
||||||
|
Loading…
Reference in New Issue
Block a user