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

Add constructor to JSONWriter which takes wrapperFunction and namedListStyle

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.x, master (7.0)
    • Component/s: None
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

      Currently JSONWriter's constructor extracts the wrapperFunction and namedListStyle from the request.

      This patch adds a new constructor where these are passed in from JSONResponseWriter. This will allow us to decide in JSONResponseWriter which writer to construct based on the named list style.

      There is precedent here - GeoJSONResponseWriter extracts geofield from the request and passes it to GeoJSONWriter.

      1. SOLR-9551.patch
        3 kB
        Christine Poerschke
      2. SOLR-9551.patch
        4 kB
        Jonny Marks

        Issue Links

          Activity

          Hide
          jm100 Jonny Marks added a comment -

          Attaching patch

          Show
          jm100 Jonny Marks added a comment - Attaching patch
          Hide
          cpoerschke Christine Poerschke added a comment -

          Hi Jonny, we talked offline. Please find attached an alternative patch:

          • the protected JSONWriter.wrapperFunction remains non-final
          • no unnecessary JSONResponseWriter.write change
          • the JSON_NL_* constants remain in JSONWriter but now have package visibility e.g. for use by the newly added JSONWriterTest.testConstantsUnchanged method and also for use by the upcoming SOLR-9442 change
          Show
          cpoerschke Christine Poerschke added a comment - Hi Jonny, we talked offline. Please find attached an alternative patch: the protected JSONWriter.wrapperFunction remains non-final no unnecessary JSONResponseWriter.write change the JSON_NL_* constants remain in JSONWriter but now have package visibility e.g. for use by the newly added JSONWriterTest.testConstantsUnchanged method and also for use by the upcoming SOLR-9442 change
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit ef5da9705d99561f5dda7cdbed0b6f5b5ebf66d4 in lucene-solr's branch refs/heads/master from Christine Poerschke
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ef5da97 ]

          SOLR-9551: Add JSONWriter constructor variant, JSONWriterTest.testConstantsUnchanged test. (Jonny Marks, Christine Poerschke)

          Show
          jira-bot ASF subversion and git services added a comment - Commit ef5da9705d99561f5dda7cdbed0b6f5b5ebf66d4 in lucene-solr's branch refs/heads/master from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ef5da97 ] SOLR-9551 : Add JSONWriter constructor variant, JSONWriterTest.testConstantsUnchanged test. (Jonny Marks, Christine Poerschke)
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit b8dd3be93a77f319788e141808bd894bb745e575 in lucene-solr's branch refs/heads/branch_6x from Christine Poerschke
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=b8dd3be ]

          SOLR-9551: Add JSONWriter constructor variant, JSONWriterTest.testConstantsUnchanged test. (Jonny Marks, Christine Poerschke)

          Show
          jira-bot ASF subversion and git services added a comment - Commit b8dd3be93a77f319788e141808bd894bb745e575 in lucene-solr's branch refs/heads/branch_6x from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=b8dd3be ] SOLR-9551 : Add JSONWriter constructor variant, JSONWriterTest.testConstantsUnchanged test. (Jonny Marks, Christine Poerschke)
          Hide
          cpoerschke Christine Poerschke added a comment -

          Thanks Jonny!

          Show
          cpoerschke Christine Poerschke added a comment - Thanks Jonny!

            People

            • Assignee:
              cpoerschke Christine Poerschke
              Reporter:
              jm100 Jonny Marks
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development