mirror of
https://github.com/rancher/steve.git
synced 2025-09-22 20:09:34 +00:00
Update VisitArray
This commit is contained in:
@@ -16,28 +16,17 @@ func (s *schemaFieldVisitor) VisitArray(array *proto.Array) {
|
||||
field := definitionField{
|
||||
Description: array.GetDescription(),
|
||||
}
|
||||
// this currently is not recursive and provides little information for nested types- while this isn't optimal,
|
||||
// it was kept this way to provide backwards compat with previous endpoints.
|
||||
array.SubType.Accept(s)
|
||||
subField := s.field
|
||||
// Recursively visit the value subtype
|
||||
subVisitor := &schemaFieldVisitor{definitions: s.definitions}
|
||||
array.SubType.Accept(subVisitor)
|
||||
subField := subVisitor.field
|
||||
// Represent the map as "array[<value_type>]"
|
||||
field.Type = "array[" + subField.Type + "]"
|
||||
s.field = field
|
||||
}
|
||||
|
||||
// VisitMap turns a map into a definitionField (stored on the receiver). For maps of complex types, will also visit the
|
||||
// subtype.
|
||||
//func (s *schemaFieldVisitor) VisitMap(protoMap *proto.Map) {
|
||||
// field := definitionField{
|
||||
// Description: protoMap.GetDescription(),
|
||||
// }
|
||||
// // this currently is not recursive and provides little information for nested types- while this isn't optimal,
|
||||
// // it was kept this way to provide backwards compat with previous endpoints.
|
||||
// protoMap.SubType.Accept(s)
|
||||
// subField := s.field
|
||||
// field.Type = "map[" + subField.Type + "]"
|
||||
// s.field = field
|
||||
//}
|
||||
|
||||
func (s *schemaFieldVisitor) VisitMap(protoMap *proto.Map) {
|
||||
field := definitionField{
|
||||
Description: protoMap.GetDescription(),
|
||||
|
Reference in New Issue
Block a user