[Pulp-dev] renaming user facing fields on content serializers
dellweg at atix.de
Tue Sep 10 08:32:48 UTC 2019
TL;DR: Should the fields "_relative_path" and "_artifact" on the
SingleArtifactSerializer be renamed to "relative_path" and "artifact"
While working on the upload create content serializer story , i
noticed, that there are two fields on the
SingleArtifactContentSerializer with unnecessary complicated names
("_artifact" and "_relative_path"). In fact, all descendent
serializers, i know of take some hurdle  to rename "_relative_path"
back to "relative_path".
I believe, the leading underscore was added for a convention, that
pulpcore controlled database fields should not take names (like "href"),
that may be needed by plugins to represent a domain specific api.
I think, the naming here is taking this convention one step too far in
that the serializers themselves are merely a convenience layer for the
plugin writer, and those serializer fields do not directly correspond
to database fields on any content model. Moreover the file plugin turns
"relative_path" (without "_") into a real database field, and given the
name is seems safe to use a relative_path_validator on a string field
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 833 bytes
Desc: OpenPGP digital signature
More information about the Pulp-dev