nytimes / openapi2proto

A tool for generating Protobuf v3 schemas and gRPC service definitions from OpenAPI specifications
Apache License 2.0
961 stars 98 forks source link

Failed to transpile Kubernetes swagger.json: "'$ref' key contains non-string element (map[string]interface {})" #128

Open curiousleo opened 4 years ago

curiousleo commented 4 years ago

Generating protos for https://github.com/kubernetes/kubernetes/blob/965137a992ed755474f17fa6377ee3555745addd/api/openapi-spec/swagger.json failed:

$ openapi2proto -spec kubernetes-swagger.json
error: failed to transpile: failed to load OpenAPI spec: failed to resolve external references: failed to resolve object: failed to resolve map element for definitions: failed to resolve map element for io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps: failed to resolve map element for properties: '$ref' key contains non-string element (map[string]interface {})

I don't know what this error means. It is certainly possible that this has been reported before -- it is possible that this is a duplicate of https://github.com/nytimes/openapi2proto/issues/82.

curiousleo commented 4 years ago

Possibly useful for future reference: https://github.com/kubernetes/kube-openapi is the code that generates the Kubernetes OpenAPI spec (from Go structs in https://github.com/kubernetes/kubernetes).