Skip to content

Commit af75372

Browse files
committed
fix: add max_length to tag strings in GenerateDescriptionRequest
Individual tag strings were unbounded — 20 tags of 1 MB each could bypass the 50 KB definition_yaml limit. Constrain each tag to 64 chars.
1 parent cb9d730 commit af75372

File tree

1 file changed

+3
-1
lines changed
  • src/edictum_server/schemas

1 file changed

+3
-1
lines changed

src/edictum_server/schemas/ai.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from __future__ import annotations
44

5+
from typing import Annotated
6+
57
from pydantic import BaseModel, Field
68

79

@@ -53,7 +55,7 @@ class GenerateDescriptionRequest(BaseModel):
5355
name: str = Field(..., max_length=255)
5456
type: str = Field(..., max_length=32)
5557
definition_yaml: str = Field(..., max_length=50_000)
56-
tags: list[str] = Field(default_factory=list, max_length=20)
58+
tags: list[Annotated[str, Field(max_length=64)]] = Field(default_factory=list, max_length=20)
5759

5860

5961
class GenerateDescriptionResponse(BaseModel):

0 commit comments

Comments
 (0)