kubernetes / kube-openapi

Kubernetes OpenAPI spec generation & serving
Apache License 2.0
318 stars 207 forks source link

Having the same type embedded more than once breaks generation #129

Open enj opened 5 years ago

enj commented 5 years ago

ServiceServingCertSignerConfig embeds metav1.TypeMeta and configv1.GenericControllerConfig: https://github.com/openshift/api/blob/master/servicecertsigner/v1alpha1/types.go#L15-L21

At the time, configv1.GenericControllerConfig also embedded metav1.TypeMeta, which led to:

func schema_openshift_api_servicecertsigner_v1alpha1_ServiceServingCertSignerConfig(ref common.ReferenceCallback) common.OpenAPIDefinition {
    return common.OpenAPIDefinition{
        Schema: spec.Schema{
            SchemaProps: spec.SchemaProps{
                Description: "ServiceServingCertSignerConfig provides information to configure a serving serving cert signing controller",
                Properties: map[string]spec.Schema{
                    "kind": {
                        SchemaProps: spec.SchemaProps{
                            Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds",
                            Type:        []string{"string"},
                            Format:      "",
                        },
                    },
                    "apiVersion": {
                        SchemaProps: spec.SchemaProps{
                            Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources",
                            Type:        []string{"string"},
                            Format:      "",
                        },
                    },
                    "kind": {
                        SchemaProps: spec.SchemaProps{
                            Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds",
                            Type:        []string{"string"},
                            Format:      "",
                        },
                    },
                    "apiVersion": {
                        SchemaProps: spec.SchemaProps{
                            Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources",
                            Type:        []string{"string"},
                            Format:      "",
                        },
                    },
pkg/openapi/zz_generated.openapi.go:24107:6: duplicate key "kind" in map literal
pkg/openapi/zz_generated.openapi.go:24114:6: duplicate key "apiVersion" in map literal
fejta-bot commented 5 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot commented 5 years ago

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle rotten

enj commented 5 years ago

/remove-lifecycle rotten /lifecycle frozen

awgrass commented 4 days ago

Does it make sense for me to tackle this as my first contribution?