how do you ensure that two plugins from different “vendors” (i’m using this as a generic term here, they don’t have to be companies, can also be a random person on github) don’t use the same name? you probably don’t have a copyright/trademark e.g. on
_anomaly_detection (and even if you do, others might not have one on their plugin name). using a vendor prefix usually alleviates these issues.
it’s the same with java: you also don’t name your package
foo, you name it
foo isn’t unique.
_plugins as another prefix in front of that in turn helps prevent that any vendor (or, if you leave that out, plugin) name collides with any future plans for new endpoints in the core product. otherwise you’d either need a complete list of all plugins which exist (which you can’t have since some will probably never be published) or accept potentially breaking a plugin (making any new API endpoint automatically a new major release according to semver).
=> i’d go for
/_plugins/somevendor/someplugin. so in your example
which brings me to the next question: why the
_ prefix for the plugin name? if it’s prefixed with
/_plugins you don’t need it in the plugin name again. and also for
/_plugins i’m not sure whether you need the
_ prefix (though that might be an elasticsearch/opensearch convention? there are a bunch of APIs with this prefix)
you could treat opensearch core plugins in a special way and e.g. say that instead of writing
opensearch as the vendor you can shorten it to just
lastly: why the snake_case in the plugin name in the URL? most REST API guidelines (see e.g. Zalando RESTful API and Event Guidelines) mandate hyphenated words in the path segments.