-
Notifications
You must be signed in to change notification settings - Fork 196
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 are flattened to the underlying type. #180
Comments
This will be tricky to fix since I'm pretty sure the main repo types rely on this, especially for primitives. |
Yup, I can imagine a lot of potential for nasty surprises if the semantics of the alias kind are changed. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-contributor-experience at kubernetes/community. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Over in service-apis , I used https://github.com/ahmetb/gen-crd-api-reference-docs to generate the CRD API documentation. This project uses gengo to parse the Go types for the CRD, and generates HTML documentation.
In the service-apis CRD, we use type aliases like this:
The end result of this is that all the aliases get flattened to the underlying type
ConfigMapsDefaultLocalObjectReference
.I'm not at all familiar with any of the machinery underlying this, but the only way I could see to detect the alias was using IsAlias on the type name before walking the type. Once you do this, it might be reasonable to emit the type alias as a type of Kind "Alias", but I'm not sure whether that's a good idea or not.
Here's a bit of a patch that I was messing with that is probably very naive about different type alias possibilities:
The text was updated successfully, but these errors were encountered: