You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Christos Malliaridis (Jira)" <ji...@apache.org> on 2024/06/09 03:28:00 UTC

[jira] [Created] (SOLR-17326) Wrong class resolution in generated API response classes

Christos Malliaridis created SOLR-17326:
-------------------------------------------

             Summary: Wrong class resolution in generated API response classes
                 Key: SOLR-17326
                 URL: https://issues.apache.org/jira/browse/SOLR-17326
             Project: Solr
          Issue Type: Bug
      Security Level: Public (Default Security Level. Issues are Public)
          Components: SolrJ
    Affects Versions: 9.6.1, 8.11.3
            Reporter: Christos Malliaridis


When a naming conflict occurs between the response class and the return type (API model) included in the response of the v2 API, the {{java-template/api.mustache}} template will use the response class as return type and ignore the API model. This results in missing fields and parsing errors when calling {{JacksonParsingResponse.getParsed()}}.

The affected response classes are:
 * {{CoreSnapshotsApi.DeleteSnapshotResponse}}
 * {{CollectionSnapshotsApi.CreateCollectionSnapshotResponse}}
 * {{CollectionSnapshotsApi.DeleteCollectionSnapshotResponse}}
 * {{CollectionsApi.ListCollectionsResponse}}
 * {{AliasPropertiesApi.GetAllAliasPropertiesResponse}}
 * {{AliasPropertiesApi.GetAliasPropertyResponse}}
 * {{AliasesApi.GetAliasByNameResponse}}

All above classes have the same name as their corresponding return type and differ only in the package name. The generated classes therefore references the response classes and not the API models from {{org.apache.solr.client.api.model}} in the generic type.

In order to use the information from the responses custom code that bypasses {{JacksonParsingresponse.getParsed()}} is required, otherwise parsing errors may occur.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org