Skip to content

Commit d44e339

Browse files
authored
Merge pull request #388 from gerrod3/api-docs-fix
Fix inconsistencies in restapi documentaiton
2 parents d9b2c93 + 1c1ee91 commit d44e339

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

pulp_python/app/serializers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class PythonPackageContentSerializer(core_serializers.SingleArtifactContentUploa
110110
read_only=True,
111111
)
112112
sha256 = serializers.CharField(
113-
default='', allow_blank=True,
113+
default='',
114114
help_text=_('The SHA256 digest of this package.'),
115115
)
116116
metadata_version = serializers.CharField(
@@ -328,7 +328,7 @@ class PythonRemoteSerializer(core_serializers.RemoteSerializer):
328328
)
329329
policy = serializers.ChoiceField(
330330
help_text=_("The policy to use when downloading content. The possible values include: "
331-
"'immediate', 'on_demand', and 'cache_only'. 'immediate' is the default."),
331+
"'immediate', 'on_demand', and 'streamed'. 'on_demand' is the default."),
332332
choices=core_models.Remote.POLICY_CHOICES,
333333
default=core_models.Remote.ON_DEMAND
334334
)
@@ -400,7 +400,7 @@ class PythonBanderRemoteSerializer(serializers.Serializer):
400400

401401
policy = serializers.ChoiceField(
402402
help_text=_("The policy to use when downloading content. The possible values include: "
403-
"'immediate', 'on_demand', and 'cache_only'. 'immediate' is the default."),
403+
"'immediate', 'on_demand', and 'streamed'. 'on_demand' is the default."),
404404
choices=core_models.Remote.POLICY_CHOICES,
405405
default=core_models.Remote.ON_DEMAND
406406
)

pulp_python/app/viewsets.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020

2121
class PythonRepositoryViewSet(core_viewsets.RepositoryViewSet, ModifyRepositoryActionMixin):
2222
"""
23-
A ViewSet for PythonRepository.
23+
PythonRepository represents a single Python repository, to which content can be
24+
synced, added, or removed.
2425
"""
2526

2627
endpoint_name = 'python'
2728
queryset = python_models.PythonRepository.objects.all()
2829
serializer_class = python_serializers.PythonRepositorySerializer
2930

3031
@extend_schema(
31-
description="Trigger an asynchronous task to sync Python content.",
3232
summary="Sync from remote",
3333
responses={202: AsyncOperationResponseSerializer}
3434
)
@@ -37,7 +37,7 @@ def sync(self, request, pk):
3737
"""
3838
<!-- User-facing documentation, rendered as html-->
3939
Trigger an asynchronous task to sync python content. The sync task will retrieve Python
40-
content from the specified `Remote` and " update the specified `Respository`, creating a
40+
content from the specified `Remote` and update the specified `Respository`, creating a
4141
new `RepositoryVersion`.
4242
"""
4343
repository = self.get_object()
@@ -72,11 +72,12 @@ class PythonRepositoryVersionViewSet(core_viewsets.RepositoryVersionViewSet):
7272
class PythonDistributionViewSet(core_viewsets.DistributionViewSet):
7373
"""
7474
<!-- User-facing documentation, rendered as html-->
75-
Pulp Python Distributions are used to distribute
76-
<a href="../restapi.html#tag/publications">Python Publications.</a> <b> Pulp Python
75+
Pulp Python Distributions are used to distribute Python content from
76+
<a href="./#tag/Repositories:-Python">Python Repositories</a> or
77+
<a href="./#tag/Publications:-Pypi">Python Publications.</a> <b> Pulp Python
7778
Distributions should not be confused with "Python Distribution" as defined by the Python
78-
community.</b> In Pulp usage, Python content is refered to as <a
79-
href="../restapi.html#tag/content">Python Package Content.</a>
79+
community.</b> In Pulp usage, Python content is referred to as <a
80+
href="./#tag/Content:-Packages">Python Package Content.</a>
8081
"""
8182

8283
endpoint_name = 'pypi'
@@ -134,7 +135,6 @@ class PythonRemoteViewSet(core_viewsets.RemoteViewSet):
134135
serializer_class = python_serializers.PythonRemoteSerializer
135136

136137
@extend_schema(
137-
description="Create a remote from a Bandersnatch config",
138138
summary="Create from Bandersnatch",
139139
responses={201: python_serializers.PythonRemoteSerializer},
140140
)
@@ -143,8 +143,7 @@ class PythonRemoteViewSet(core_viewsets.RemoteViewSet):
143143
def from_bandersnatch(self, request):
144144
"""
145145
<!-- User-facing documentation, rendered as html-->
146-
Takes the fields specified in the Bandersnatch config and creates a Python Remote from
147-
it.
146+
Takes the fields specified in the Bandersnatch config and creates a Python Remote from it.
148147
"""
149148
serializer = self.get_serializer(data=request.data)
150149
serializer.is_valid(raise_exception=True)
@@ -196,7 +195,6 @@ class PythonPublicationViewSet(core_viewsets.PublicationViewSet):
196195
serializer_class = python_serializers.PythonPublicationSerializer
197196

198197
@extend_schema(
199-
description="Trigger an asynchronous task to publish python content.",
200198
responses={202: AsyncOperationResponseSerializer}
201199
)
202200
def create(self, request):

0 commit comments

Comments
 (0)