Skip to content
Snippets Groups Projects
Commit 3e81c7a3 authored by ml bonhomme's avatar ml bonhomme :bee: Committed by Erwan Rouchet
Browse files

Document worker type filter

parent b9fdf674
No related branches found
No related tags found
1 merge request!2015Document worker type filter
......@@ -102,6 +102,7 @@ from arkindex.project.mixins import (
SelectionMixin,
WorkerACLMixin,
)
from arkindex.project.openapi import UUID_OR_STR
from arkindex.project.pagination import CustomCursorPagination
from arkindex.project.permissions import IsVerified, IsVerifiedOrReadOnly
from arkindex.project.tools import PercentileCont, RTrimChr
......@@ -802,6 +803,12 @@ class RevisionRetrieve(RepositoryACLMixin, RetrieveAPIView):
type=str,
description='Filter workers by name.',
required=False,
),
OpenApiParameter(
'type',
type=UUID_OR_STR,
description='Filter workers by type, using either a type UUID or a type slug.',
required=False,
)
]
),
......
......@@ -14,3 +14,12 @@ UUID_OR_FALSE = {
{'type': 'boolean', 'enum': [False]},
]
}
# A JSON Schema that allows either an UUID or a string, to allow filtering by either an ID or a slug, for example
# when filtering by worker type.
UUID_OR_STR = {
'oneOf': [
{'type': 'string', 'format': 'uuid'},
{'type': 'string'},
]
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment