config: omit empty subpolicies in yaml/json (#1229)

This commit is contained in:
Travis Groth 2020-08-07 14:43:28 -04:00 committed by GitHub
parent 1b365e52f3
commit fbb367d393
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -116,7 +116,7 @@ type Policy struct {
// to upstream requests.
EnableGoogleCloudServerlessAuthentication bool `mapstructure:"enable_google_cloud_serverless_authentication" yaml:"enable_google_cloud_serverless_authentication,omitempty"` //nolint
SubPolicies []SubPolicy `mapstructure:"sub_policies" yaml:"sub_policies" json:"sub_policies"`
SubPolicies []SubPolicy `mapstructure:"sub_policies" yaml:"sub_policies,omitempty" json:"sub_policies,omitempty"`
}
// A SubPolicy is a protobuf Policy within a protobuf Route.