diff --git a/services/dns/src/stackit/dns/models/create_record_set_payload.py b/services/dns/src/stackit/dns/models/create_record_set_payload.py index 77c1a86b7..7eae40ea2 100644 --- a/services/dns/src/stackit/dns/models/create_record_set_payload.py +++ b/services/dns/src/stackit/dns/models/create_record_set_payload.py @@ -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( diff --git a/services/dns/src/stackit/dns/models/record_set.py b/services/dns/src/stackit/dns/models/record_set.py index bb38d4a24..778191fb4 100644 --- a/services/dns/src/stackit/dns/models/record_set.py +++ b/services/dns/src/stackit/dns/models/record_set.py @@ -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") @@ -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