Skip to content

Commit

Permalink
Merge pull request #79 from ynte/patch-1
Browse files Browse the repository at this point in the history
Fix usage.md imports
  • Loading branch information
foarsitter authored May 23, 2024
2 parents 481cbbb + 9a2c48a commit ed7720b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@

```python
from httpx import Client
from requestmodel import RequestModel, BaseModel
from pydantic import BaseModel

from requestmodel import RequestModel
from requestmodel.params import Path, Query
from typing_extensions import Annotated


# define your response,
# preferably we generate it with datamodel-code-generator based on an OpenAPI spec
class MyResponse(BaseModel):
id: int
name: str


# describe your request
# the goal is to follow the rules FastAPI uses to describe endpoints
class MyRequest(RequestModel[MyResponse]):
Expand Down Expand Up @@ -42,8 +46,9 @@ that can be used for paginated responses by implementing `IteratorRequestModel.n
from typing import List, Optional

from httpx import Client
from pydantic import BaseModel

from requestmodel import IteratorRequestModel, BaseModel
from requestmodel import IteratorRequestModel


class MyResponse(BaseModel):
Expand Down

0 comments on commit ed7720b

Please sign in to comment.