-
Notifications
You must be signed in to change notification settings - Fork 791
SOLR-16395: Convert v2 "schema" modification APIs to JAX-RS #3299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SOLR-16395: Convert v2 "schema" modification APIs to JAX-RS #3299
Conversation
Will enable SchemaChangeOperation to serve as the processing format for both v1 and v2 requests down the line, when SchemaManager is cut over to it.
Still more test failues to address, but progress!
|
This isn't quite ready for prime-time yet, but I wanted to make the broad strokes available for review if anyone's curious. Much of the code in this PR is currently in service of making |
Still needed:
- finish "bulk" API
- prompt PR discussion about "copyfield" APIs
- ref-guide updates
- remove existing Api-based v2 APIs (where present)
- unit tests for parameter-validation
- manual tests for error cases (to make sure errors come through
similarly)
This cleans up most of the remaining TODOs prior to this being "ready-for-review", including removal of the old 'Api' based Schema binding, updates to our ref-guide, and some additional unit tests to ensure that missing required properties trigger appropriate errors. Still TODO is a better look at the generated v2 request objects, which aren't picking up the request-bodies for certain endpoints for whatever reason. Some debugging still needed there...
|
Alright, the JAX-RS code is in place so I've marked this as "Ready for Review". This has turned into a pretty big PR, but it does cover a pretty large chunk of our API surface so it represents a pretty big step forward in our v2 coverage. One thing that I've left out of this PR, that we'll want to think through and handle separately are v2 APIs for "copy-field" modification. All of our other schema entities (fields, field-types, and dynamic-fields) have names that allow you to address them with nice clean resource-based paths like I wasn't sure how to handle them, so I've "punted" in this PR. The best approach I can think of currently is a |
|
Still TODO (mostly reminders to self pre-merge):
|
|
|
||
| createJettyAndHarness( | ||
| tmpSolrHome, "solrconfig-managed-schema.xml", "schema-rest.xml", "/solr", true, null); | ||
| if (random().nextBoolean()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The v2 Schema APIs now differ from v1 by more than just the path prefix, so this quick-and-dirty randomization no longer works.
https://issues.apache.org/jira/browse/SOLR-16395\
Description
Many v2 APIs remain on the legacy v2 API framework, including a number of APIs allowing individual and bulk modifications to collection schemas.
Solution
This PR converts a number of Solr's schema-modification APIs to JAX-RS. It also makes some tweaks to the appearance of the v2 endpoints, to make them align a little better with the overall "REST-ful" design being targeted by our v2 APIs.
The following APIs have been converted and updated.
PUT /collections/collName/schema/fields/fieldName {...}DELETE /collections/collName/schema/fields/fieldNamePUT /collections/collName/schema/fieldtypes/fieldTypeName {...}DELETE /collections/collName/schema/fieldtypes/fieldTypeNamePUT /collections/cName/schema/dynamicfieldtypes/dFNameDELETE /collections/cName/schema/dynamicfieldtypes/dFNamePOST /collections/cName/schema/bulkSee the ref-guide updates in this PR for complete details on updated v2 API appearance/operation.
JAX-RS conversion has the additional benefit of adding the APIs to our OpenAPI spec ("OAS"), and to all of the downstream artifacts (e.g. SolrJ bindings) generated from that.
Tests
See new tests (mostly serialization/deserialization related) in
SchemaManagerUtilsTestandSchemaChangeOperationSerializationTest.Checklist
Please review the following and check all that apply:
mainbranch../gradlew check.