This PR is a continuation of previous work by @annakhm on test-reflect branch on the following aspects.
Functional
Support conversion of primitive schema types: int, bool, string
Support conversion of nested schema types: list, set
Nested struct in sdk model should be represented as list with at most 1 element, with metadata SchemaType set to struct
List or set of primitive data types (int, bool, string) should use *ExtendedSchema as Schema.Elem
List or set of struct data types should use *ExtendedResource as Schema.Elem, and set Metadata.ReflectType to the type of element type in the slice, rather than a slice type.
UT under metadata/metaddata_test.go can be referenced as example use cases.
Non-Functional
Refactored reflect code into own package for adding isolated UT
Moved version check logic to utils package, so both nsxt and metadata package can share the code
This PR is a continuation of previous work by @annakhm on test-reflect branch on the following aspects.
Functional
SchemaType
set tostruct
*ExtendedSchema
asSchema.Elem
*ExtendedResource
asSchema.Elem
, and setMetadata.ReflectType
to the type of element type in the slice, rather than a slice type.metadata/metaddata_test.go
can be referenced as example use cases.Non-Functional
utils
package, so bothnsxt
andmetadata
package can share the codeTBD in a future PR