feat: minimum lengths for names
All checks were successful
ci / lint_and_test (push) Successful in 15s
All checks were successful
ci / lint_and_test (push) Successful in 15s
This commit is contained in:
parent
092e12a892
commit
43ed768f66
4 changed files with 13 additions and 15 deletions
|
|
@ -6,28 +6,21 @@ Models follow the nomenclature of:
|
|||
- Models: "<Module><Method><Resource><Opt:Resource><Direction>" ie "ServiceGetServiceResponse"
|
||||
"""
|
||||
|
||||
from pydantic import ConfigDict
|
||||
from pydantic import Field
|
||||
|
||||
from src.schemas import CustomBaseModel, ServiceIDMixin
|
||||
from src.schemas import CustomBaseModel, ServiceIDMixin, ServiceSummary
|
||||
|
||||
|
||||
class ServiceSchema(CustomBaseModel):
|
||||
model_config = ConfigDict(from_attributes=True, extra="ignore")
|
||||
|
||||
id: int
|
||||
name: str
|
||||
|
||||
|
||||
class ServiceWithKeySchema(ServiceSchema):
|
||||
class ServiceWithKeySchema(ServiceSummary):
|
||||
api_key: str
|
||||
|
||||
|
||||
class ServiceGetServiceResponse(CustomBaseModel):
|
||||
services: list[ServiceSchema]
|
||||
services: list[ServiceSummary]
|
||||
|
||||
|
||||
class ServicePostServiceRequest(CustomBaseModel):
|
||||
name: str
|
||||
name: str = Field(min_length=3)
|
||||
|
||||
|
||||
class ServicePostServiceResponse(CustomBaseModel):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue