<div dir="ltr">Matthias,<div><br></div><div>I agree. Can you open an issue?<br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><br></div><div>David<br></div></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 10, 2019 at 4:39 AM Matthias Dellweg <<a href="mailto:dellweg@atix.de">dellweg@atix.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">TL;DR: Should the fields "_relative_path" and "_artifact" on the<br>
SingleArtifactSerializer be renamed to "relative_path" and "artifact"<br>
respectively?<br>
<br>
While working on the upload create content serializer story [0], i<br>
noticed, that there are two fields on the<br>
SingleArtifactContentSerializer with unnecessary complicated names<br>
("_artifact" and "_relative_path"). In fact, all descendent<br>
serializers, i know of take some hurdle [1] to rename "_relative_path"<br>
back to "relative_path".<br>
I believe, the leading underscore was added for a convention, that<br>
pulpcore controlled database fields should not take names (like "href"),<br>
that may be needed by plugins to represent a domain specific api.<br>
I think, the naming here is taking this convention one step too far in<br>
that the serializers themselves are merely a convenience layer for the<br>
plugin writer, and those serializer fields do not directly correspond<br>
to database fields on any content model. Moreover the file plugin turns<br>
"relative_path" (without "_") into a real database field, and given the<br>
name is seems safe to use a relative_path_validator on a string field<br>
here.<br>
<br>
[0] <a href="https://pulp.plan.io/issues/5403?pn=1#note-4" rel="noreferrer" target="_blank">https://pulp.plan.io/issues/5403?pn=1#note-4</a><br>
[1]<br>
<a href="https://github.com/pulp/pulp_file/blob/b348e970d4ddcd2d7c9dc0b206a3fdd9cfc83cef/pulp_file/app/serializers.py#L36" rel="noreferrer" target="_blank">https://github.com/pulp/pulp_file/blob/b348e970d4ddcd2d7c9dc0b206a3fdd9cfc83cef/pulp_file/app/serializers.py#L36</a><br>
[2]<br>
<a href="https://github.com/pulp/pulp_file/blob/b348e970d4ddcd2d7c9dc0b206a3fdd9cfc83cef/pulp_file/app/serializers.py#L54" rel="noreferrer" target="_blank">https://github.com/pulp/pulp_file/blob/b348e970d4ddcd2d7c9dc0b206a3fdd9cfc83cef/pulp_file/app/serializers.py#L54</a><br>
_______________________________________________<br>
Pulp-dev mailing list<br>
<a href="mailto:Pulp-dev@redhat.com" target="_blank">Pulp-dev@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/pulp-dev</a><br>
</blockquote></div>