Pait

Latest version: v1.0.0

Safety actively analyzes 621679 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 7

1.0.0

Improve Open API related functions and refactor some APIs that affect performance
> Note: This version will have syntax changes that are not backward compatible, and the library api status will change from alpha to beta

Function Changes List:
- `get_app_attribute` support werkzeug LocalProxy
- 'sniffing' and 'framework_location' support customization
- [Field] Depend enhances support for class instances.
- [Field] Depend support parse depend.pait_handler method.
- [Field] Adds the parameter `not_authenticated_exc`, which allows developers to specify that the error value cannot be found.
- [Field] Adds the parameter `openapi_include`, determines whether the field can be resolved to the Open API.
- [Field] Add _check_init_param method
- [OpenAPI] Support OpenAPI Security.
- [Pait] Modify the generation of Pait id to ensure that the Pait id is always the same.
- [Pait] Imported ParamHandler migration from PaitCoreModel to Pait.
- [Pait] Improving the speed of dependencyinjection.
- [Pait] Pait core model support extra param.
- [Pait] Pait core model support listen change callback.
- [Plugin] Optimize the internal implementation of the plug-in mechanism to speed up the execution of the plug-in.
- [Plugin] Refactor the Mock plugin's API to reduce duplicate code.
- [Plugin] The Mock plugin adds a new parameter example_column_name to specify the value of the Field from which the mock data is to be retrieved.
- [Plugin] No longer distinguish between front or back plugins by is_core, but by different classes to facilitate Type Hint checking.
- [Plugin] Response Plugin add get_pait_response_model param
- [Pydantic] Support Pydantic V1 and V2
- [Pydantic] support pydantic json_schema_extra type maybe callable
- [Route] Support for adding simple routing to web frameworks (experimental).
- [TestHelper] Ddd diff response data output and modify test helper exc msg style
- [WebFramework] support sanic 23.3.0 and support flask 2.2.2 test client

Fix:
- [Plugin] Fix param plugin`check_field_type method not support pydantic.Field
- [Pait] Fix sub pait cannot over parent pait value
- [TestHelper] Fix test helper not support response data is {}.
- [Util] Fix `get_parameter_list_from_pydantic_basemodel` not auto set request key and cache bug
- [Util] Fix `gen_example_dict_from_pydantic_base_model` acn not parse sub pydantic model
- [Util] Fix 'value._evaluate' in python3.9
- [Util] Fix parse TypedDict error(py310)
- [Util] Fix Lazy property bug

Refactor:
- [gRPC Gateway] this feature has been migrated to [grpc-gateway](https://github.com/python-pai/grpc-gateway)


API Changes:
- `pait`: The tag parameter type no longer supports String, only support `Tag` class. e.g:
python
from pait.app.starlette import pait
from pait.model.tag import Tag

pait(tag=Tag("Demo"))
def demo() -> None:
pass

- `pait.model.response`:
- `pait.model.response.PaitBaseResponseModel`change name to`BaseResponseModel`
python
from pait.model.response import BaseResponseModel

- The `ResponseModel.header` parameter type no longer supports dict, only support `pydantic.BaseModel`. e.g:
python
from pait.model.response import HtmlResponseModel
from pydantic import BaseModel, Field

class HtmlRespModel(HtmlResponseModel):
class HeaderModel(BaseModel):
x_example_type: str = Field(default="html", alias="X-Example-Type")

header: BaseModel = HeaderModel
description: str = "html response"

- All DocRoute and gRPC Gateway APIs of the module have undergone drastic changes, please refer to the document changes
0.8.0[Now]
Rewrite part of the implementation of gRPC Gateway, and transfer some functions to [protobuf_to_pydantic](https://github.com/so1n/protobuf_to_pydantic)

0.7.9

- Feature, Support for unregulated typing usage
- Fix, fix auto complete json bug
- Feature, gRPC Gateway route param support custom pait.field
- Feature, add rapidoc and rapipdf api doc html
- Fix, gRpc Gateway generates a schema of the same name

0.7.8.2

- Feature, support custom custom grpc route response model

0.7.8.1

- Feature, support custom Redoc and Swagger url

0.7.8

- Feature, cache response support cache exc
- Feature, GrpcGateWay add gen route method
- Feature, Change self logic
- Fix, fix pydantic.BaseModel schema required is True, when default factory is not None
- Fix, fix tornado cache response bug and add cache response test
- Fix, fix auto complete not support dict in list
- Test, merge app route unitest
- Test, add customer grpc gateway route example&test
- Test, Split out to improve the speed of test cases
- Style, add typed file

0.7.7

Add grpc gateway route, Automatically generate corresponding API requests based on Stub

Page 1 of 7

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.