Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CreateRecordSetPayload(BaseModel):
default=None, description="user comment"
)
name: Annotated[str, Field(min_length=1, strict=True, max_length=253)] = Field(
description="name of the record which should be a valid domain according to rfc1035 Section 2.3.4"
description="name of the record which should be a valid domain according to rfc1035 Section 2.3.4. For APEX records (same as zone name), the zone name itself has to be put in here."
)
records: List[RecordPayload] = Field(description="records")
ttl: Optional[Annotated[int, Field(le=99999999, strict=True, ge=60)]] = Field(
Expand Down
25 changes: 22 additions & 3 deletions services/dns/src/stackit/dns/models/record_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class RecordSet(BaseModel):
)
id: StrictStr = Field(description="rr set id")
name: Annotated[str, Field(min_length=1, strict=True, max_length=253)] = Field(
description="name of the record which should be a valid domain according to rfc1035 Section 2.3.4"
description="name of the record which should be a valid domain according to rfc1035 Section 2.3.4. For APEX records (same as zone name), the zone name itself has to be put in here."
)
records: Annotated[List[Record], Field(min_length=1)] = Field(description="records")
state: StrictStr = Field(description="record set state")
Expand Down Expand Up @@ -93,9 +93,28 @@ def state_validate_enum(cls, value):
@field_validator("type")
def type_validate_enum(cls, value):
"""Validates the enum"""
if value not in set(["A", "AAAA", "SOA", "CNAME", "NS", "MX", "TXT", "SRV", "PTR", "ALIAS", "DNAME", "CAA"]):
if value not in set(
[
"A",
"AAAA",
"SOA",
"CNAME",
"NS",
"MX",
"TXT",
"SRV",
"PTR",
"ALIAS",
"DNAME",
"CAA",
"CSYNC",
"HINFO",
"SSHFP",
"HTTPS",
]
):
raise ValueError(
"must be one of enum values ('A', 'AAAA', 'SOA', 'CNAME', 'NS', 'MX', 'TXT', 'SRV', 'PTR', 'ALIAS', 'DNAME', 'CAA')"
"must be one of enum values ('A', 'AAAA', 'SOA', 'CNAME', 'NS', 'MX', 'TXT', 'SRV', 'PTR', 'ALIAS', 'DNAME', 'CAA', 'CSYNC', 'HINFO', 'SSHFP', 'HTTPS')"
)
return value

Expand Down
Loading