-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support field custom documentation strings (#394)
Adds support for extending the documentation strings for fields and setting docstrings for custom fields. A new `FieldConfig.Documentation` configuration option is now supported. When present, this string *extends* any documentation provided for the existing field by the doc-2.json files. If no such documentation is provided by the existing field OR if the field is a custom field, the `FieldConfig.Documentation` configuration option is used for the field's docstring in the Go type files. Example usage for an existing nested field (from a hypothetical ec2 generator.yaml file). The `LaunchTemplateData.HibernationOptions.Configured` field has a docstring already that contains the following: ``` // If you set this parameter to true, the instance is enabled for hibernation. // // Default: false ``` Setting the `generator.yaml` file to the following: ```yaml resources: LaunchTemplate: fields: LaunchTemplateData.HibernationOptions.Configured: documentation: XXX extended docs XXX ``` would cause the field's Documentation string to look like this: ``` // If you set this parameter to true, the instance is enabled for hibernation. // // Default: false // // XXX extended docs XXX", ``` Issue aws-controllers-k8s/community#1223 Signed-off-by: Jay Pipes <jaypipes@gmail.com>
- Loading branch information
Showing
5 changed files
with
183 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
pkg/testdata/models/apis/ec2/0000-00-00/generator-with-doc-overrides.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
ignore: | ||
resource_names: | ||
- AccountAttribute | ||
- CapacityReservation | ||
- CarrierGateway | ||
- ClientVpnEndpoint | ||
- ClientVpnRoute | ||
- CustomerGateway | ||
- DefaultSubnet | ||
- DefaultVpc | ||
- DhcpOptions | ||
- EgressOnlyInternetGateway | ||
- Fleet | ||
- FpgaImage | ||
- Image | ||
- Instance | ||
- InstanceExportTask | ||
- InternetGateway | ||
- KeyPair | ||
- LaunchTemplateVersion | ||
#- LaunchTemplate | ||
- LocalGatewayRouteTableVpcAssociation | ||
- LocalGatewayRoute | ||
- ManagedPrefixList | ||
- NatGateway | ||
- NetworkAclEntry | ||
- NetworkAcl | ||
- NetworkInsightsPath | ||
- NetworkInterfacePermission | ||
- NetworkInterface | ||
- PlacementGroup | ||
- ReservedInstancesListing | ||
- RouteTable | ||
- Route | ||
- SecurityGroup | ||
- Snapshot | ||
- SpotDatafeedSubscription | ||
- Subnet | ||
- TrafficMirrorFilterRule | ||
- TrafficMirrorFilter | ||
- TrafficMirrorSession | ||
- TrafficMirrorTarget | ||
- TransitGatewayConnectPeer | ||
- TransitGatewayConnect | ||
- TransitGatewayMulticastDomain | ||
- TransitGatewayPeeringAttachment | ||
- TransitGatewayPrefixListReference | ||
- TransitGatewayRouteTable | ||
- TransitGatewayRoute | ||
- TransitGatewayVpcAttachment | ||
- TransitGateway | ||
- Volume | ||
- VpcEndpointConnectionNotification | ||
- VpcEndpointServiceConfiguration | ||
- VpcEndpoint | ||
- Vpc | ||
- VpcCidrBlock | ||
- VpcPeeringConnection | ||
- VpnConnectionRoute | ||
- VpnConnection | ||
- VpnGateway | ||
resources: | ||
LaunchTemplate: | ||
fields: | ||
LaunchTemplateData.HibernationOptions.Configured: | ||
documentation: XXX extended docs XXX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters