Re: [PR] SOLR-17743: V2 API: use correct content-type [solr]

2025-04-27 Thread via GitHub


dsmiley merged PR #3326:
URL: https://github.com/apache/solr/pull/3326


-- 
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]



Re: [PR] SOLR-17743: V2 API: use correct content-type [solr]

2025-04-17 Thread via GitHub


gerlowskija commented on code in PR #3326:
URL: https://github.com/apache/solr/pull/3326#discussion_r2048779297


##
solr/solrj/src/resources/java-template/api.mustache:
##
@@ -205,26 +203,23 @@ public class {{classname}} {
 
 @Override
 @SuppressWarnings("unchecked")
-public RequestWriter.ContentWriter getContentWriter(String 
expectedType) {
+public RequestWriter.ContentWriter getContentWriter(String 
_expectedTypeIGNORE) {

Review Comment:
   [0] Maybe some version of this rationale should live as a comment in the 
code/template, so that we can notice when those preconditions/assumptions 
change?
   
   e.g.
   
   > // v2 currently only supports reading JSON request-bodies, so we ignore 
the expected type suggestion provided by callers.
   
   



-- 
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]



Re: [PR] SOLR-17743: V2 API: use correct content-type [solr]

2025-04-17 Thread via GitHub


gerlowskija commented on code in PR #3326:
URL: https://github.com/apache/solr/pull/3326#discussion_r2048771074


##
solr/solrj/src/resources/java-template/api.mustache:
##
@@ -133,7 +133,6 @@ public class {{classname}} {
 {{#isBodyParam}}
 {{#vendorExtensions.x-genericEntity}}
 this.requestBody = requestBody;
-addHeader("Content-type", "application/json");

Review Comment:
   I do like that better from an abstraction perspective, but I remember 
putting this line here only after noticing that relying on the ContentWriter 
was leaving the header unset in some cases.  I wish I remembered the context 
there better.
   
   But let's not worry about that now - if it crops up again I'll reinvestigate 
at that point...



-- 
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]



Re: [PR] SOLR-17743: V2 API: use correct content-type [solr]

2025-04-13 Thread via GitHub


dsmiley commented on code in PR #3326:
URL: https://github.com/apache/solr/pull/3326#discussion_r2041364372


##
solr/solrj/src/resources/java-template/api.mustache:
##
@@ -205,26 +203,23 @@ public class {{classname}} {
 
 @Override
 @SuppressWarnings("unchecked")
-public RequestWriter.ContentWriter getContentWriter(String 
expectedType) {
+public RequestWriter.ContentWriter getContentWriter(String 
_expectedTypeIGNORE) {

Review Comment:
   `getContentWriter` is passed an "expectedType" from the 
`SolrClient.requestWriter` which defaults to "javabin".  But V2 should ignore 
that requestWriter as it's opinionated on how to write -- only supports JSON 
via Jackson or raw writing.  Perhaps that field in SolrClient should be named 
`defaultRequestWriter`... although we're not choosing a different RequestWriter 
so :shrug:



##
solr/solrj/src/resources/java-template/api.mustache:
##
@@ -133,7 +133,6 @@ public class {{classname}} {
 {{#isBodyParam}}
 {{#vendorExtensions.x-genericEntity}}
 this.requestBody = requestBody;
-addHeader("Content-type", "application/json");

Review Comment:
   This doesn't belong here.  It's the ContentWriter that's responsible for the 
type.



-- 
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]