Files
milvus/internal/distributed/proxy/httpserver
zhuwenxingandGitHub 14c4cf65fc enhance: add dynamic StructArray field APIs (#50276)
issue: #50235

### What problem does this PR solve?

This PR adds API support for dynamically adding StructArray fields to an
existing collection, aligned with the existing Python SDK API shape.

### What is changed?

- Add Go SDK `Client.AddCollectionStructField(...)` and
`NewAddCollectionStructFieldOption(...)`.
- Convert Go SDK StructArray field schema into
`AddCollectionStructFieldRequest`.
- Preserve StructArray parent `nullable` and `max_capacity` when
converting schemas and describing collections.
- Add REST v2 endpoint:
  - `POST /v2/vectordb/collections/struct_fields/add`
- Reject StructArray payloads from the ordinary REST v2 field endpoint:
  - `POST /v2/vectordb/collections/fields/add`
- Support REST v2 StructArray add payloads using both:
  - `dataType: "Array", elementDataType: "Struct"`
  - `dataType: "ArrayOfStruct"`
- Add Go SDK and REST v2 regression coverage.

### Verification

- `milvus-dev-cli go-ut local . -b master -t
internal/distributed/proxy/httpserver -k 'TestAddCollectionFieldSuite'
-f`
  - `ut-go-local-zhuwenxi-issue-50235-cbec6c2-26ef323b`
- `milvus-dev-cli build local . -b master -f`
  - `build-local-zhuwenxing-issue-50235-clea-cbec6c2`
- `milvus-dev-cli deploy create
build-local-zhuwenxing-issue-50235-clea-cbec6c2 --name
issue-50235-struct-add`
- `pytest -q
testcases/test_collection_operations.py::TestCollectionAddField::test_add_struct_array_field
--endpoint http://10.100.36.203:19530 --token root:Milvus --minio_host
10.100.36.198`
  - `2 passed`

---------

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2026-06-12 15:30:21 +08:00
..