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

This commit is contained in:
2026-01-29 13:53:50 +00:00
parent d909561a05
commit be29f27a7e

42
src/models/request.py Normal file
View 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}
}
}
}
}