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

RawExtension for arbitrary JSON #69

Closed
artasparks opened this issue Oct 26, 2018 · 1 comment
Closed

RawExtension for arbitrary JSON #69

artasparks opened this issue Oct 26, 2018 · 1 comment

Comments

@artasparks
Copy link
Contributor

Kubernetes uses the RawExtension type to represent arbitrary JSON components. Right now in the proto-world, I'm using Struct and in the Go IDL version (soon to come) I'll probably use map[string]interface{} for compatibility. But this is non-standard and the standard type for this purpose is RawExtension.

https://github.com/kubernetes/apimachinery/blob/ed135c5b96450fd24e5e981c708114fbbd950697/pkg/runtime/types.go

type RawExtension struct {
	// Raw is the underlying serialization of this object.
	//
	// TODO: Determine how to detect ContentType and ContentEncoding of 'Raw' data.
	Raw []byte `protobuf:"bytes,1,opt,name=raw"`
	// Object can hold a representation of this extension - useful for working with versioned
	// structs.
	Object Object `json:"-"`
}
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

No branches or pull requests

1 participant