[ 
https://issues.apache.org/jira/browse/SOLR-11028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17617733#comment-17617733
 ] 

Jason Gerlowski commented on SOLR-11028:
----------------------------------------

The way this type of v2 API is written, it's mostly "just" a wrapper that 
reorganizes the inputs into the format v1 expects, and then calls into the v1 
codepath.  So in terms of validating that the (e.g.) REPLACENODE functionality 
actually works as its supposed to - I think we can rely on the existing v1 
tests for that.  So the main thing that needs tests IMO is the "reorganizes the 
inputs into the format v1 expects" bit.  Essentially, given a v2 API with 
inputs A, B, and C, do those values get modified (if necessary) and passed on 
down to the v1 code correctly.

[V2CollectionAPIMappingTest.testModifyCollectionAllProperties|https://github.com/apache/solr/blob/a1ee7c1d0de32779109cb8b66a4319a0f8c85037/solr/core/src/test/org/apache/solr/handler/admin/api/V2CollectionAPIMappingTest.java#L89]
 is a decent example of this.  The first section of that test uses the 
{{captureConvertedV1Params}} method to simulate an incoming v2 API request and 
record the params that get passed down to CollectionsHandler.handleRequestBody 
by the v2 code.  From there, the remainder of the test asserts that the v1 
parameters look the way they should. Several parameters from the JSON body are 
flattened into query-params mostly "as-is", the "action" and "collection" 
query-params are added, the nested JSON map of properties is "flattened" into 
individual query-params, etc.

Does that help?

> Create a v2 API equivalent for REPLACENODE API
> ----------------------------------------------
>
>                 Key: SOLR-11028
>                 URL: https://issues.apache.org/jira/browse/SOLR-11028
>             Project: Solr
>          Issue Type: Sub-task
>          Components: SolrCloud, v2 API
>            Reporter: Shalin Shekhar Mangar
>            Priority: Major
>
> The REPLACENODE API is only implemented as part of the v1 collections API. 
> There should be an equivalent call in the v2 paradigm.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to