Skip to content

Commit

Permalink
update schemas formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mahenzon committed Aug 15, 2023
1 parent 45b4e9b commit b96ac1a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions fastapi_jsonapi/atomic/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,17 @@ def validate_operation(cls, values: dict):


class AtomicOperationRequest(BaseModel):
operations: List[AtomicOperation] = Field(alias="atomic:operations")
operations: List[AtomicOperation] = Field(
alias="atomic:operations",
min_length=1,
)


class AtomicResult(BaseModel):
data: Optional[dict] = Field(default=None, description="the “primary data” resulting from the operation.")
data: Optional[dict] = Field(
default=None,
description="the “primary data” resulting from the operation.",
)
meta: Optional[dict] = Field(
default=None,
description="a meta object that contains non-standard meta-information about the result.",
Expand All @@ -153,4 +159,7 @@ class AtomicResultResponse(BaseModel):
https://jsonapi.org/ext/atomic/#auto-id-responses-4
"""

results: List[AtomicResult] = Field(alias="atomic:results")
results: List[AtomicResult] = Field(
alias="atomic:results",
min_length=1,
)

0 comments on commit b96ac1a

Please sign in to comment.