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
|
|
@ -9,7 +9,7 @@ Models follow the nomenclature of:
|
|||
from typing import Optional
|
||||
from datetime import datetime
|
||||
|
||||
from pydantic import EmailStr, ConfigDict
|
||||
from pydantic import EmailStr, ConfigDict, Field
|
||||
|
||||
from src.schemas import (
|
||||
CustomBaseModel,
|
||||
|
|
@ -55,7 +55,7 @@ class OrgSchema(OrgIDMixin):
|
|||
|
||||
|
||||
class OrgPostOrgRequest(CustomBaseModel):
|
||||
name: str
|
||||
name: str = Field(min_length=3)
|
||||
intake_questionnaire: Optional[CurrentQuestions] = None
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -55,3 +55,8 @@ class GroupSummary(CustomBaseModel):
|
|||
class UserSummary(CustomBaseModel):
|
||||
id: int
|
||||
email: str
|
||||
|
||||
|
||||
class ServiceSummary(CustomBaseModel):
|
||||
id: int
|
||||
name: str
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ def generate_query_and_status(params) -> list[tuple[str, int]]:
|
|||
|
||||
def generate_body_and_status(params: dict[str, str]) -> list[tuple[dict, int]]:
|
||||
possible_values_int = [0, -1, 42, "banana", ""]
|
||||
possible_values_str = [0]
|
||||
possible_values_str = [0, "", "a"]
|
||||
|
||||
defaults = [{param: 1 for param in params.keys()}]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue