Jeroboam View¶
- class flask_jeroboam.view.JeroboamView(rule, original_view_func, options, response_class=<class 'flask_jeroboam.responses.JSONResponse'>)¶
Bases:
object
Adds flask-jeroboam features to a regular flask view function.
The InboundHandler and OutboundHandler are configured here. The as_view property returns an augmented view function ready to be used by Flask, adding inbound and outbound data handling behavior if needed. The resulting view function is a regular flask view function, and any overhead related to figuring out what needs to be done is spent at registration time.
- Parameters:
rule (str) –
original_view_func (Callable[[...], Response | DataClassType | BaseModel | str | bytes | List[Any] | List[BaseModel] | Mapping[str, Any] | Iterator[str] | Iterator[bytes] | DataclassProtocol | Tuple[Response | DataClassType | BaseModel | str | bytes | List[Any] | List[BaseModel] | Mapping[str, Any] | Iterator[str] | Iterator[bytes] | DataclassProtocol, Headers | Mapping[str, str | List[str] | Tuple[str, ...]] | Sequence[Tuple[str, str | List[str] | Tuple[str, ...]]]] | Tuple[Response | DataClassType | BaseModel | str | bytes | List[Any] | List[BaseModel] | Mapping[str, Any] | Iterator[str] | Iterator[bytes] | DataclassProtocol, int] | Tuple[Response | DataClassType | BaseModel | str | bytes | List[Any] | List[BaseModel] | Mapping[str, Any] | Iterator[str] | Iterator[bytes] | DataclassProtocol, int, Headers | Mapping[str, str | List[str] | Tuple[str, ...]] | Sequence[Tuple[str, str | List[str] | Tuple[str, ...]]]] | WSGIApplication] | Callable[[...], Awaitable[Response | DataClassType | BaseModel | str | bytes | List[Any] | List[BaseModel] | Mapping[str, Any] | Iterator[str] | Iterator[bytes] | DataclassProtocol | Tuple[Response | DataClassType | BaseModel | str | bytes | List[Any] | List[BaseModel] | Mapping[str, Any] | Iterator[str] | Iterator[bytes] | DataclassProtocol, Headers | Mapping[str, str | List[str] | Tuple[str, ...]] | Sequence[Tuple[str, str | List[str] | Tuple[str, ...]]]] | Tuple[Response | DataClassType | BaseModel | str | bytes | List[Any] | List[BaseModel] | Mapping[str, Any] | Iterator[str] | Iterator[bytes] | DataclassProtocol, int] | Tuple[Response | DataClassType | BaseModel | str | bytes | List[Any] | List[BaseModel] | Mapping[str, Any] | Iterator[str] | Iterator[bytes] | DataclassProtocol, int, Headers | Mapping[str, str | List[str] | Tuple[str, ...]] | Sequence[Tuple[str, str | List[str] | Tuple[str, ...]]]] | WSGIApplication]]) –
options (Dict[str, Any]) –
response_class (Type | None) –
- property as_view: Callable[[...], Response | DataClassType | BaseModel | str | bytes | List[Any] | List[BaseModel] | Mapping[str, Any] | Iterator[str] | Iterator[bytes] | DataclassProtocol | Tuple[Response | DataClassType | BaseModel | str | bytes | List[Any] | List[BaseModel] | Mapping[str, Any] | Iterator[str] | Iterator[bytes] | DataclassProtocol, Headers | Mapping[str, str | List[str] | Tuple[str, ...]] | Sequence[Tuple[str, str | List[str] | Tuple[str, ...]]]] | Tuple[Response | DataClassType | BaseModel | str | bytes | List[Any] | List[BaseModel] | Mapping[str, Any] | Iterator[str] | Iterator[bytes] | DataclassProtocol, int] | Tuple[Response | DataClassType | BaseModel | str | bytes | List[Any] | List[BaseModel] | Mapping[str, Any] | Iterator[str] | Iterator[bytes] | DataclassProtocol, int, Headers | Mapping[str, str | List[str] | Tuple[str, ...]] | Sequence[Tuple[str, str | List[str] | Tuple[str, ...]]]] | WSGIApplication] | Callable[[...], Awaitable[Response | DataClassType | BaseModel | str | bytes | List[Any] | List[BaseModel] | Mapping[str, Any] | Iterator[str] | Iterator[bytes] | DataclassProtocol | Tuple[Response | DataClassType | BaseModel | str | bytes | List[Any] | List[BaseModel] | Mapping[str, Any] | Iterator[str] | Iterator[bytes] | DataclassProtocol, Headers | Mapping[str, str | List[str] | Tuple[str, ...]] | Sequence[Tuple[str, str | List[str] | Tuple[str, ...]]]] | Tuple[Response | DataClassType | BaseModel | str | bytes | List[Any] | List[BaseModel] | Mapping[str, Any] | Iterator[str] | Iterator[bytes] | DataclassProtocol, int] | Tuple[Response | DataClassType | BaseModel | str | bytes | List[Any] | List[BaseModel] | Mapping[str, Any] | Iterator[str] | Iterator[bytes] | DataclassProtocol, int, Headers | Mapping[str, str | List[str] | Tuple[str, ...]] | Sequence[Tuple[str, str | List[str] | Tuple[str, ...]]]] | WSGIApplication]]¶
Decorate the orinal view function with handlers..
TODO: Deal with name, docs, before decorating
- property main_method: str¶
Return the main HTTP verb of the Endpoint.
- property parameters: List[SolvedArgument]¶
Return the main HTTP verb of the Endpoint.