Skip to content
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-15742: Convert v2 /update APIs to annotations #868

Conversation

gerlowskija
Copy link
Contributor

Description

Solr's been in the slow process of moving its v2 APIs away from the
existing apispec/mapping framework towards one that relies on more
explicit annotations to specify API properties. Many have been
converted, but many more still remain.

Solution

This commit takes a chunk out of this work by converting the APIs
from the core.Update apispec file to the "new" framework.

Tests

Some unit tests for the v2->v1 mapping in V2UpdateAPIMappingTest

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide

Solr's been in the slow process of moving its v2 APIs away from the
existing apispec/mapping framework towards one that relies on more
explicit annotations to specify API properties.

This commit converts the APIs from the core.Update apispec file to
the "new" framework.
* Api} implementations associated with each RequestHandler, and registers them in an {@link
* org.apache.solr.api.ApiBag}. Since UpdateRequestHandler is mentioned multiple times in
* ImplicitPlugins.json (once for each update API: /update, /update/json, etc.), this would cause
* the v2 APIs to be registered in duplicate. To avoid this, Solr has this RequestHandler, whose
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great piece of javadocs ;-)

*
* <p>Most of these v2 APIs are implemented as pure "pass-throughs" to the v1 code paths, but there
* are a few exceptions: /update and /update/json are both rewritten to /update/json/docs, and
* /update/json/commands has its path changed to /update/json.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to keep the /update/json/commands, sounds like something that is orphaned/abandoned?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, we do not need them anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, removed. Thanks for the prompt guys.

- one needed updated to reflect a change to ImplicitPlugins.json
- one helped catch a bug in UpdateAPI that's now fixed
- one failure was caused by a larger structural bug that I filed a
  ticket for, but only work around in this current PR.  See SOLR-16205.
@gerlowskija gerlowskija merged commit ba4cc63 into apache:main May 20, 2022
@gerlowskija gerlowskija deleted the SOLR-15742-convert-update-apis-to-annotations branch May 20, 2022 13:42
gerlowskija added a commit to gerlowskija/solr that referenced this pull request Jun 2, 2022
Solr's been in the slow process of moving its v2 APIs away from the
existing apispec/mapping framework towards one that relies on more
explicit annotations to specify API properties.

This commit converts the APIs from the core.config.Params apispec file
to the "new" framework.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants