Skip to content

Commit

Permalink
feat: add pydantic model for Problem response schema
Browse files Browse the repository at this point in the history
  • Loading branch information
edaniszewski committed Nov 5, 2020
1 parent 2460f83 commit e9349f2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
15 changes: 15 additions & 0 deletions fastapi_rfc7807/schema.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""Pydantic model for the Problem response schema."""

from typing import Optional

from pydantic import BaseModel


class Problem(BaseModel):
"""Model of the RFC7807 Problem response schema."""

type: str
title: str
status: Optional[int]
detail: Optional[str]
instance: Optional[str]
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#
# pip-compile --output-file=requirements.txt setup.py
#
dataclasses==0.7 # via pydantic
fastapi==0.60.1 # via fastapi_rfc7807 (setup.py)
pydantic==1.6.1 # via fastapi
pydantic==1.6.1 # via fastapi, fastapi_rfc7807 (setup.py)
starlette==0.13.6 # via fastapi, fastapi_rfc7807 (setup.py)
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
install_requires=[
'fastapi',
'starlette',
'pydantic',
],
keywords=[
'fastapi', 'errors', 'middleware', 'rfc7807',
Expand Down

0 comments on commit e9349f2

Please sign in to comment.