<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Mar 27, 2018 at 1:36 PM, Jeremy Audet <span dir="ltr"><<a href="mailto:jaudet@redhat.com" target="_blank">jaudet@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">> The current plugin API allows plugin authors to define custom REST API endpoints that can perform any custom validation needed for the plugin. The repository version creation REST API provided by pulpcore only validates that the content exists. We should document this limitation and recommend that users use Repository Version creation APIs provided by specific plugins.<br>
<br>
</span>Why should I, as a user, explicitly call HTTP API endpoints to make<br>
sure that Pulp's state is valid? That seems very strange. I'd rather<br>
not worry about that. If there's a path forward that lets plugins<br>
enforce correctness, that seems like a far better path forward.<br>
</blockquote></div><br></div><div class="gmail_extra">There is already a way for plugins to enforce correctness by defining REST API endpoints that perform validation. Here are the main points of concern that need to be addressed:<br></div><div class="gmail_extra"><ul><li>/api/v3/repositories/<uuid>/versions/ endpoint does not perform plugin specific validation which can lead to "broken" repository versions.</li><li>Plugin authors don't have any convention to follow when creating custom REST API endpoints for creating repository versions. <br></li><li>As a result of ^, a user will have a hard time identifying repository version creation APIs in different plugins. <br></li></ul>My first inclination is to disable the ability to POST to /api/v3/repositories/<uuid>/versions/ and require users to use the plugin specific APIs for creating repository versions. However, I think that integrators of build systems that produce a variety of content types would have a lot more flexibility if they could use a single generic API endpoint to create a repository version independent of the content type. <br><br></div><div class="gmail_extra">Let's continue this discussion by answering the following question: <br><ul><li>Should we disable the ability to POST to /api/v3/repositories/<uuid>/versions/ and require users to always use a plugin specific repository version creation API?</li></ul></div></div>