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

ASF subversion and git services commented on SOLR-16825:
--------------------------------------------------------

Commit 326753c2ee548cec74d7e52f31fd303fda033dee in solr's branch 
refs/heads/main from Jason Gerlowski
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=326753c2ee5 ]

SOLR-16825: Generate v2 API SolrRequest bindings  (#1793)

Prior to this commit, SolrJ had no real coverage of v2 APIs beyond the
generic V2Request class.  This commit introduces the first request-
specific v2 SolrRequest implementations to SolrJ.

Rather than duplicating details about the API here in SolrJ so that both
the server-side API definition and the client objects need maintained
by hand, this commit generates the v2 SolrRequest classes from the
OpenAPI specification (which in turn is generated from the server-side
API definition).  This ensures that there's only one "source of truth"
that needs maintained for each API.

To achieve this, this commit introduces a new gradle module, 'api', to
hold interfaces (representing Solr's APIs) and POJOs (representing the
API's inputs and outputs).  This module is all that is needed to generate
Solr's OpenAPI spec, and for SolrJ in turn to generate SolrRequest
implementations from that spec.

This commit restricts v2 SolrRequest generation to a few example APIs
to prove the approach.  Additional APIs will be added in subsequent
commits.

---------

Co-authored-by: Houston Putman <hous...@apache.org>

> Generate Java bindings from OpenAPI spec
> ----------------------------------------
>
>                 Key: SOLR-16825
>                 URL: https://issues.apache.org/jira/browse/SOLR-16825
>             Project: Solr
>          Issue Type: Improvement
>          Components: v2 API
>            Reporter: Jason Gerlowski
>            Priority: Major
>          Time Spent: 5.5h
>  Remaining Estimate: 0h
>
> SOLR-16346 added support to Solr's build to generate an "OpenAPI spec" file 
> describing our v2 API.  But currently, this spec file isn't actually used by 
> Solr in any way.
> Spec files can be used for a variety of purposes, including to [generate 
> client bindings|https://github.com/OpenAPITools/openapi-generator] for using 
> the API.
> The client generation capabilities provided by the OpenAPI project cover a 
> variety of languages, but it make sense for Solr to start with Java since we 
> already have a Java client that requires continual effort to keep up to date. 
>  It'd be a big win for the project if we were able to replace some or all of 
> the manually maintained "SolrRequest" implementations in SolrJ with 
> automatically generated code.  



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

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

Reply via email to