adityamparikh opened a new pull request, #294:
URL: https://github.com/apache/solr-mcp/pull/294
## Summary
`list-collections` and `list-aliases` return records that follow Solr's
Collections API responses instead of a bare array and a SolrJ-derived map.
```diff
list-collections, solr://collections
- ["books", "films"]
+ {"collections": ["books", "films"]} #
LIST, minus responseHeader
list-aliases
- {"tv": "shows,shows_typed"} #
SolrJ getAliases(): properties dropped
+ {"aliases": {"tv": "shows,shows_typed"}, "properties": {"tv": {...}}} #
LISTALIASES, minus responseHeader
```
```text
listCollections() → objectMapper.convertValue(response.asMap(),
CollectionList.class)
listAliases() → objectMapper.convertValue(response.asMap(),
AliasList.class)
CollectionList(collections, other)
@JsonIgnoreProperties("responseHeader")
AliasList(aliases, properties, other) missing sections reported as
empty
```
`other` is a `@JsonAnySetter @JsonAnyGetter` catch-all: a property a later
Solr version adds to either response is passed on at the same level instead of
dropped. `AliasService` now takes the `JsonMapper` that does the conversion.
Collection-name completion reads `listCollections().collections()`.
## Evidence
- **Before:** `list-aliases` on an alias with a property returned only
`{"tv":"shows,shows_typed"}`.
**After:** `AliasServiceTest.keepsPropertiesAndUnknownSections` pins
`{"aliases":{"tv":"shows,shows_typed"},"properties":{"tv":{"owner":"search-team"}},"futureSection":"x"}`,
with the `responseHeader` dropped.
- `CollectionServiceTest.getCollectionsResource_Success`: the resource
returns `{"collections":["collection1","collection2"]}`, the same JSON as the
tool.
- `McpClientIntegrationTestBase.listCollectionsContainsCreatedCollection`
(HTTP and STDIO) parses the tool output as `{"collections": [...]}` through
Spring AI's serialization.
- `./gradlew build`: 459 tests, 0 failures, 0 skipped.
- `./gradlew nativeTest -Pnative`: 302 successful, 0 failed; the alias,
collection-listing and method-security tests pass in the native image. The 154
skipped are the `@DisabledInNativeImage` Mockito tests.
## Merge Danger
**Door:** two-way
**Blast Radius:** list-consumers
The JSON of `list-collections`, `solr://collections` and `list-aliases`
changes from a bare array and a flat map to objects. A client that parsed the
array or read alias names at the top level has to read `collections` /
`aliases`. Java callers of `listCollections()` / `listAliases()` get the
records instead of `List<String>` / `Map<String,String>`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]