Skip to content
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

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

Open
curiousleo opened this issue Sep 16, 2020 · 1 comment · May be fixed by #129

Comments

@curiousleo
Copy link

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 #82.

curiousleo added a commit to curiousleo/openapi2proto that referenced this issue Sep 16, 2020
Fixes nytimes#128 and nytimes#82.

Changes:
- Ignore $ref declarations that are not strings (dubious)
- Allow builtins as RPC return types
- Update Kubernetes proto fixture (dubious)
@curiousleo curiousleo linked a pull request Sep 16, 2020 that will close this issue
@curiousleo
Copy link
Author

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).

sanposhiho pushed a commit to sanposhiho/openapi2proto that referenced this issue May 21, 2023
Fixes nytimes#128 and nytimes#82.

Changes:
- Ignore $ref declarations that are not strings (dubious)
- Allow builtins as RPC return types
- Update Kubernetes proto fixture (dubious)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant