Skip to content

Commit

Permalink
📝 Add Docs for Usage Examples
Browse files Browse the repository at this point in the history
  • Loading branch information
0xsirsaif committed Nov 11, 2024
1 parent c790d3a commit 59f94e5
Show file tree
Hide file tree
Showing 5 changed files with 844 additions and 22 deletions.
22 changes: 2 additions & 20 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,10 @@ This project is currently in beta. Expect changes and improvements as we work to

The goal is to build a better API framework for Frappe.

FrappeAPI follows FastAPI's interface and semantics. For in-depth information about specific features, you can refer to [FastAPI's documentation](https://fastapi.tiangolo.com/).

## Installation

```bash
pip install frappeapi
```

## Example

Here's an example of how to use FrappeAPI:

```python
from frappeapi import FrappeAPI

app = FrappeAPI()

@app.get()
def get_book(isbn: str):
book = {
"title": "To Kill a Mockingbird",
"author": "Harper Lee",
"isbn": "9780446310789",
"available": True
}
return book
```
17 changes: 16 additions & 1 deletion docs/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,23 @@

- [x] String validations, `min_length`, `max_length`, `pattern`.
- [x] Numeric validations, `gt`, `ge`, `lt`, `le`.
- [x] Metadata, `title`, `description`, `deprecated`.
- [x] Metadata, `title`, `description`.
- [x] others, `include_in_schema`.
- [ ] `deprecated`

## Response Model Features

- [x] Method `response_model` parameter to define response model as Pydantic model. `response_model=Model`, `response_model=list[Model]` ...etc
- [x] Response model as return type with standard type hints or Pydantic model. `-> Model`, `-> list[Model]`...etc
- [x] Limit and filter the output data to what is defined in the return type.
- [x] `response_model` parameter takes precedence over return type if both are provided.
- [ ] `response_model_include` to include only specific fields in response
- [ ] `response_model_exclude` to exclude specific fields from response
- [ ] `response_model_by_alias` to control whether to use field aliases in response
- [ ] `response_model_exclude_unset` to exclude unset fields from response
- [ ] `response_model_exclude_defaults` to exclude fields with default values from response
- [ ] `response_model_exclude_none` to exclude None fields from response
- [ ] Support for Union response models (multiple possible response types)

## Rate Limiting

Expand Down
Loading

0 comments on commit 59f94e5

Please sign in to comment.