Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-17326

Wrong class resolution in generated API response classes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 8.11.3, 9.6.1
    • main (10.0), 9.7
    • SolrJ

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              gerlowskija Jason Gerlowski
              malliaridis Christos Malliaridis
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m