Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions .github/workflows/docs.yml

This file was deleted.

16 changes: 0 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
help:
@echo "Targets:"
@echo " make setuptools"
@echo " make install"
@echo " make test"
@echo " make build"
@echo " make lint"
@echo " make publish"
@echo " make bumpversion-major"
@echo " make bumpversion-minor"
@echo " make bumpversion-patch"
@echo " make clean"
@echo " make clean-test"

Expand All @@ -18,15 +11,6 @@ lint:
test:
pytest

bumpversion-major:
bumpversion major --allow-dirty

bumpversion-minor:
bumpversion minor

bumpversion-patch:
bumpversion patch

clean:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
Expand Down
46 changes: 0 additions & 46 deletions docs/code_of_conduct.md

This file was deleted.

33 changes: 0 additions & 33 deletions docs/contributing.md

This file was deleted.

Binary file removed docs/favicon.png
Binary file not shown.
79 changes: 0 additions & 79 deletions docs/index.md

This file was deleted.

14 changes: 0 additions & 14 deletions docs/installation.md

This file was deleted.

15 changes: 0 additions & 15 deletions docs/license.md

This file was deleted.

50 changes: 0 additions & 50 deletions docs/overview.md

This file was deleted.

27 changes: 14 additions & 13 deletions fastapi_class/decorators.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import inspect
from enum import Enum
from typing import Any, Callable, Dict, List, Optional, Sequence, Type, TypeVar, Union

Expand All @@ -24,13 +25,13 @@ def route(
"""

def marker(method: AnyCallable) -> AnyCallable:
setattr(
method,
"_endpoint",
EndpointDefinition(
endpoint=method, args=RouteArgs(path=path, methods=methods, **kwargs)
),
)
args = RouteArgs(path=path, methods=methods, **kwargs)
if args.name is None:
args.name = method.__name__
if not args.description:
description = inspect.cleandoc(method.__doc__ or "")
args.description = description or " "
setattr(method, "_endpoint", EndpointDefinition(endpoint=method, args=args))
return method

return marker
Expand Down Expand Up @@ -144,7 +145,7 @@ def post(
)


def put(
def patch(
path: str,
*,
response_model: Optional[Type[Any]] = None,
Expand Down Expand Up @@ -172,7 +173,7 @@ def put(
) -> Callable[[AnyCallable], AnyCallable]:
return route(
path,
methods=["PUT"],
methods=["PATCH"],
response_model=response_model,
status_code=status_code,
tags=tags,
Expand All @@ -198,7 +199,7 @@ def put(
)


def delete(
def put(
path: str,
*,
response_model: Optional[Type[Any]] = None,
Expand Down Expand Up @@ -226,7 +227,7 @@ def delete(
) -> Callable[[AnyCallable], AnyCallable]:
return route(
path,
methods=["DELETE"],
methods=["PUT"],
response_model=response_model,
status_code=status_code,
tags=tags,
Expand All @@ -252,7 +253,7 @@ def delete(
)


def patch(
def delete(
path: str,
*,
response_model: Optional[Type[Any]] = None,
Expand Down Expand Up @@ -280,7 +281,7 @@ def patch(
) -> Callable[[AnyCallable], AnyCallable]:
return route(
path,
methods=["PATCH"],
methods=["DELETE"],
response_model=response_model,
status_code=status_code,
tags=tags,
Expand Down
Loading