Initial upload: API Mock CLI v0.1.0
Some checks failed
CI / test (3.10) (push) Has been cancelled
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / test (3.9) (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / type-check (push) Has been cancelled
CI / build (push) Has been cancelled
Some checks failed
CI / test (3.10) (push) Has been cancelled
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / test (3.9) (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / type-check (push) Has been cancelled
CI / build (push) Has been cancelled
This commit is contained in:
42
src/models/request.py
Normal file
42
src/models/request.py
Normal file
@@ -0,0 +1,42 @@
|
||||
from typing import Optional, Dict, Any, List
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class RequestValidation(BaseModel):
|
||||
body: Optional[Dict[str, Any]] = Field(
|
||||
default=None,
|
||||
description="JSON Schema for request body validation"
|
||||
)
|
||||
query: Optional[Dict[str, Any]] = Field(
|
||||
default=None,
|
||||
description="Query parameter validation rules"
|
||||
)
|
||||
headers: Optional[Dict[str, Any]] = Field(
|
||||
default=None,
|
||||
description="Header validation rules"
|
||||
)
|
||||
path: Optional[Dict[str, Any]] = Field(
|
||||
default=None,
|
||||
description="Path parameter validation rules"
|
||||
)
|
||||
|
||||
class Config:
|
||||
json_schema_extra = {
|
||||
"example": {
|
||||
"body": {
|
||||
"type": "object",
|
||||
"required": ["name", "email"],
|
||||
"properties": {
|
||||
"name": {"type": "string", "minLength": 1},
|
||||
"email": {"type": "string", "format": "email"}
|
||||
}
|
||||
},
|
||||
"query": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"page": {"type": "integer", "minimum": 1},
|
||||
"limit": {"type": "integer", "minimum": 1, "maximum": 100}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user