Fork API types.

This commit is contained in:
Brendan Burns
2014-07-16 14:30:28 -07:00
parent cb28f25b1b
commit bf5ae4bb9d
15 changed files with 1251 additions and 76 deletions

View File

@@ -28,8 +28,11 @@ func TestAPIObject(t *testing.T) {
Object APIObject `yaml:"object,omitempty" json:"object,omitempty"`
EmptyObject APIObject `yaml:"emptyObject,omitempty" json:"emptyObject,omitempty"`
}
AddKnownTypes(EmbeddedTest{})
convert := func(obj interface{}) (interface{}, error) { return obj, nil }
AddKnownTypes("", EmbeddedTest{})
AddKnownTypes("v1beta1", EmbeddedTest{})
AddExternalConversion("EmbeddedTest", convert)
AddInternalConversion("EmbeddedTest", convert)
outer := &EmbeddedTest{
JSONBase: JSONBase{ID: "outer"},