add 'help_text' to valid_lables response

This commit is contained in:
Andreas Köpf
2023-01-07 21:48:11 +01:00
parent 5fb0121668
commit 5e01f421aa
3 changed files with 12 additions and 4 deletions
+4 -1
View File
@@ -38,5 +38,8 @@ def label_text(
@router.get("/valid_labels")
def get_valid_lables() -> ValidLabelsResponse:
return ValidLabelsResponse(
valid_labels=[LabelOption(name=l.value, description=l.description) for l in protocol_schema.TextLabel]
valid_labels=[
LabelOption(name=l.value, display_text=l.display_text, help_text=l.help_text)
for l in protocol_schema.TextLabel
]
)
+4 -1
View File
@@ -1,9 +1,12 @@
from typing import Optional
from pydantic import BaseModel
class LabelOption(BaseModel):
name: str
description: str
display_text: str
help_text: Optional[str]
class ValidLabelsResponse(BaseModel):