https://pulp.plan.io/https://pulp.plan.io/favicon.ico2017-10-23T21:00:46ZPulpPulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=225462017-10-23T21:00:46Zdaviddavis
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/22546/diff?detail_id=23011">diff</a>)</li></ul> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=225482017-10-24T12:35:53Zbmbouterbmbouter@redhat.com
<ul></ul><p>+1 to deleting auto_publish even if we bring it back later because it doen't do anything. We can bring it back when that features is ready to be implemented.</p> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=225492017-10-24T13:01:36Zamacdona@redhat.comaustin@redhat.com
<ul></ul><p><del>+1 to removing extra fields, but lets not leave it up to one person to figure out what they all are.</del></p>
<p><del>Before this is groomed, I'd like to see:</del><br>
<del># change to a task "Remove unused fields"</del><br>
<del># list all the fields to remove (by model)</del><br>
^ this work as been moved to a separate issue: <a href="https://pulp.plan.io/issues/3097" class="external">https://pulp.plan.io/issues/3097</a></p>
<p>Removing auto_publish and other unused fields should be a separate task. I think this issue is that all serializer parameters are accepted for every request type.</p> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=226052017-10-27T14:29:20Zamacdona@redhat.comaustin@redhat.com
<ul><li><strong>Subject</strong> changed from <i>Tons of extra params appear in the api schema</i> to <i>api schema includes the same params for all request types</i></li></ul><p>This is baked into the django rest framework. Unless we specify otherwise, a ViewSet shares a single serializer. That means that the schema will include the same params for PUT and DELETE, when DELETE should not need any.</p>
<p>The DRF way to change this is to use a different serializer for some views. We could make a destroy view that uses a destroy serializer that accepts no parameters.... But DRF doesn't raise a 400 when extra parameters are passed, so this isn't a behavior problem, but it is a documentation problem, and it would be a shame to add so much code when it wouldnt change behavior.</p>
<p>I hope that this can be fixed at the api auto-documentation level, or in the schema view.</p> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=226072017-10-27T14:37:06Zdalleydalley@redhat.com
<ul><li><strong>Sprint/Milestone</strong> set to <i>46</i></li><li><strong>Triaged</strong> changed from <i>No</i> to <i>Yes</i></li></ul> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=226092017-10-27T14:41:28Zbizhangbizhang@redhat.com
<ul></ul><p>I think this is an issue introduced in drf 3.7</p>
<p>With djangorestframework==3.6.4 installed the Artifact DELETE schema looks like:</p>
<pre><code class="json syntaxhl" data-language="json"><span class="nl">"delete"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"link"</span><span class="p">,</span><span class="w">
</span><span class="nl">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/api/v3/artifacts/{id}/"</span><span class="p">,</span><span class="w">
</span><span class="nl">"action"</span><span class="p">:</span><span class="w"> </span><span class="s2">"delete"</span><span class="p">,</span><span class="w">
</span><span class="nl">"fields"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"id"</span><span class="p">,</span><span class="w">
</span><span class="nl">"required"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
</span><span class="nl">"location"</span><span class="p">:</span><span class="w"> </span><span class="s2">"path"</span><span class="p">,</span><span class="w">
</span><span class="nl">"schema"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"id"</span><span class="p">,</span><span class="w">
</span><span class="nl">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"A UUID string identifying this artifact."</span><span class="p">,</span><span class="w">
</span><span class="nl">"_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"string"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=227652017-11-06T13:11:14Zmhrivnakmhrivnak@redhat.com
<ul><li><strong>Sprint/Milestone</strong> changed from <i>46</i> to <i>47</i></li></ul> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=228242017-11-10T01:37:55Zttereshcttereshc@redhat.com
<ul><li><strong>Status</strong> changed from <i>NEW</i> to <i>ASSIGNED</i></li><li><strong>Assignee</strong> set to <i>ttereshc</i></li></ul> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=228342017-11-10T18:36:37Zttereshcttereshc@redhat.com
<ul></ul><p><a class="user active" href="https://pulp.plan.io/users/383">bizhang</a>, +1<br>
It seems like there was a major change<sup><a href="#fn-0" id="fnref-0">1</a></sup> in schema generation to give devs more control over it.<br>
/me is looking into changes and for a right way to change our schema.</p>
<ol>
<li id="fn-0">
<p><a href="https://github.com/encode/django-rest-framework/pull/5354" class="external">https://github.com/encode/django-rest-framework/pull/5354</a> <a href="#fnref-0" aria-label="Back to reference 1">↩</a></p>
</li>
</ol>
Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=228402017-11-10T20:03:59Zdaviddavis
<ul></ul><p>FWIW, the user delete endpoint only has the id parameter and none of the other params like username or is_superuser. Not sure why it's working there.</p> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=231032017-11-30T20:59:14Zrchan
<ul><li><strong>Sprint/Milestone</strong> changed from <i>47</i> to <i>48</i></li></ul> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=231422017-12-01T20:40:51Zdaviddavis
<ul><li><strong>Tags</strong> <i>Pulp 3 MVP</i> added</li></ul> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=231592017-12-03T12:52:37Zttereshcttereshc@redhat.com
<ul><li><strong>Status</strong> changed from <i>ASSIGNED</i> to <i>POST</i></li></ul><p><a href="https://github.com/pulp/pulp/pull/3234" class="external">https://github.com/pulp/pulp/pull/3234</a></p> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=231602017-12-03T12:57:29Zttereshcttereshc@redhat.com
<ul></ul><p>FWIW, this change <a href="https://github.com/encode/django-rest-framework/pull/5454" class="external">https://github.com/encode/django-rest-framework/pull/5454</a> in DRF changed behaviour between 3.6 and 3.7.</p> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=235102017-12-19T16:18:03Zrchan
<ul><li><strong>Sprint/Milestone</strong> changed from <i>48</i> to <i>52</i></li></ul> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=237562018-01-08T21:27:10Zrchan
<ul><li><strong>Sprint/Milestone</strong> changed from <i>52</i> to <i>53</i></li></ul> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=243022018-01-30T14:16:09Zjortel@redhat.comjortel@redhat.com
<ul><li><strong>Sprint/Milestone</strong> changed from <i>53</i> to <i>54</i></li></ul> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=264112018-03-08T23:32:37Zbmbouterbmbouter@redhat.com
<ul><li><strong>Sprint</strong> set to <i>Sprint 32</i></li></ul> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=264362018-03-08T23:33:09Zbmbouterbmbouter@redhat.com
<ul><li><strong>Sprint/Milestone</strong> deleted (<del><i>54</i></del>)</li></ul> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=270132018-03-23T17:15:00Zttereshcttereshc@redhat.com
<ul><li><strong>Status</strong> changed from <i>POST</i> to <i>MODIFIED</i></li></ul><p>Applied in changeset <a class="changeset" title="Include filter fields into schema for read actions only closes #3093 https://pulp.plan.io/issues..." href="https://pulp.plan.io/projects/pulp/repository/pulp/revisions/e25a99d0e200264ec840080057ad7ac5c5c7b401">pulp|e25a99d0e200264ec840080057ad7ac5c5c7b401</a>.</p> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=275952018-04-19T15:12:00Zdkliban@redhat.com
<ul><li><strong>Sprint/Milestone</strong> set to <i>3.0.0</i></li></ul> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=427762019-04-26T20:37:26Zbmbouterbmbouter@redhat.com
<ul><li><strong>Tags</strong> deleted (<del><i>Pulp 3, Pulp 3 MVP</i></del>)</li></ul> Pulp - Issue #3093: api schema includes the same params for all request typeshttps://pulp.plan.io/issues/3093?journal_id=507562019-12-13T17:25:22Zbmbouterbmbouter@redhat.com
<ul><li><strong>Status</strong> changed from <i>MODIFIED</i> to <i>CLOSED - CURRENTRELEASE</i></li></ul>