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

Type aliases get collapsed down into the underlying type. #23

Open
jpeach opened this issue Jun 10, 2020 · 1 comment
Open

Type aliases get collapsed down into the underlying type. #23

jpeach opened this issue Jun 10, 2020 · 1 comment

Comments

@jpeach
Copy link
Contributor

jpeach commented Jun 10, 2020

Over in service-apis, we have a CRD that uses Go type aliases:

type ConfigMapsDefaultLocalObjectReference struct {
...
}

type GatewayClassParametersObjectReference = ConfigMapsDefaultLocalObjectReference
type RouteHostExtensionObjectReference = ConfigMapsDefaultLocalObjectReference
type RouteActionExtensionObjectReference = ConfigMapsDefaultLocalObjectReference

Each alias has unique doc comments describing how it should be used in context.

What happens is that a single documentation block for ConfigMapsDefaultLocalObjectReference gets generated, and it takes the comments from one of the aliases.

https://kubernetes-sigs.github.io/service-apis/spec/#networking.x-k8s.io/v1alpha1.ConfigMapsDefaultLocalObjectReference

What I'm hoping for is for each alias to emit its own unique documentation, and probably inline the fields of the type it is aliasing.

@jpeach
Copy link
Contributor Author

jpeach commented Jun 10, 2020

Looks like gengo is doing the type alias flattening, see kubernetes/gengo#180

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

1 participant