Vue Jeroboam¶
- class flask_jeroboam.view.JeroboamView(rule, original_view_func, options, response_class=<class 'flask_jeroboam.responses.JSONResponse'>)
Bases:
objectAdds 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.