[ https://issues.apache.org/jira/browse/SOLR-15740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17495827#comment-17495827 ]
Jason Gerlowski commented on SOLR-15740: ---------------------------------------- I managed to get the SchemaEdit apispec's converted pretty easily in this branch [here|https://github.com/gerlowskija/solr/tree/SOLR-15740-v2-write-schema-apis], but with a casualty: the introspect output. The introspect output comes from the apispec files themselves or from the annotations on "Payload" POJOs, for apispec and annotation-based APIs respectively. We would ideally create Payload POJOs for the {{POST /schema} API and parse the request body into these POJOs at the framework level, but the actual implementation of the API in SchemaHandler is currently written to read/consume the request body itself. So rather than trying to read the request body twice somehow, the branch I linked above punts on reading the request body entirely in the v2 API class (and thus doesn't have any Payload POJOs). Of course, this isn't a problem if we move the actual implementation logic over to the v2 API class (instead of the v2 API class being a shim that merely converts the request into the v1 format). But that's a larger refactor than typically try to get into in the annotation-framework-conversion PRs I've been working on. I guess I'll have to bite the bullet on that if no one can suggest a better option. > Rewrite v2 schema APIs using annotation framework > ------------------------------------------------- > > Key: SOLR-15740 > URL: https://issues.apache.org/jira/browse/SOLR-15740 > Project: Solr > Issue Type: Sub-task > Components: v2 API > Reporter: Jason Gerlowski > Assignee: Jason Gerlowski > Priority: Major > Labels: V2 > > Solr's v2 APIs can be implemented in 1 of 2 possible ways: an apispec (i.e. > JSON file) based approach that was originally conceived when the v2 APIs were > created, and an approach that relies on annotated POJO objects which has come > into favor more recently as it results in less duplication and inches our > APIs ones step towards a more strongly-typed future. > The consensus has emerged across several JIRAs that the annotated-POJO > approach is the one that should be used going forward, and that existing v2 > APIs should be cut over as convenient. > It's worth noting that this will cause the introspection output to lose the > "description" text for these APIs and their parameters, as there's no support > for this yet for annotation-based v2 APIs. See SOLR-15117 for more details. > This ticket aims to tackle this conversion for Solr's schema APIs. -- This message was sent by Atlassian Jira (v8.20.1#820001) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org