https://github.com/lyst/speccify
Tie together `drf-spectacular` and `djangorestframework-dataclasses` for easy-to-use apis and openapi schemas.
https://github.com/lyst/speccify
Last synced: about 1 year ago
JSON representation
Tie together `drf-spectacular` and `djangorestframework-dataclasses` for easy-to-use apis and openapi schemas.
- Host: GitHub
- URL: https://github.com/lyst/speccify
- Owner: lyst
- License: apache-2.0
- Created: 2021-06-25T08:42:44.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-01T08:32:08.000Z (almost 5 years ago)
- Last Synced: 2024-03-25T20:07:08.450Z (about 2 years ago)
- Language: Python
- Size: 92.8 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Awesome Lists containing this project
README
# Speccify
Tie together `drf-spectacular` and `djangorestframework-dataclasses` for
easy-to-use apis and openapi schemas.
## Usage
```
@dataclass
class MyQueryData():
name: str
@dataclass
class MyResponse:
length: int
@speccify.api_view(methods=["GET"], permissions=[])
def my_view(request: Request, my_query: Query[MyQueryData]) -> MyResponse:
name = my_query.name
length = len(name)
return MyResponse(length=length)
```
## License
Apache2