exsyst/normalizer-extra-bundle
Composer 安装命令:
composer require exsyst/normalizer-extra-bundle
包简介
An icing on top of the Symfony serializer cake
README 文档
README
A mostly opinionated bundle which aims to ease creation of efficient API servers with the Symfony serializer, while trying to stay lightweight.
How to use?
- Make sure you have a Symfony 3.* or 4.* project, with the Serializer component, and the Doctrine ORM ;
- Run
composer require exsyst/normalizer-extra-bundlein your project ; - Add a section to your project configuration to choose the features you want to use (see below) ;
- Further customize and/or extend the bundle's behavior if you want (documentation will come later) ;
- Start (de)serializing things!
Features and default configuration
The only features that are enabled by default are the ones that :
- Are inert on their own, or ;
- Define a reasonable, unopinionated behavior for cases that were completely unsupported.
exsyst_normalizer_extra: features: # Makes $request->request able to access the request body in the # Content-Type: application/json, application/xml, application/x-yaml, # text/csv cases and/or others depending on serializer support. # Enabled by default. request_decoder: true # Parses a JSON document in a header named "Response-Shape", # into a request attribute named "shape", used so that the client # can filter out unneeded fields. # Enabled by default. response_shape_header: true # Allows a controller to return an object or null and have it # automatically turned into a Response. # Disabled by default. serializer_view_listener: false # Allows a controller to throw a HttpException and have it # automatically turned into a Response. # Disabled by default. serializer_exception_listener: false normalizers: # A normalizer geared towards Doctrine collections, which also # supports most iterables (though in a limited way). # Disabled by default. collection: false # A normalizer for PHP 8.1+ enums. It will normalize backed enum # cases into their values, and unit enum cases into their names. # Disabled by default. enum: false # A meta-normalizer that can generate fast normalizers for most # classes, and delegate to them. # Disabled by default. specializing: false options: # Always use a breadth-first normalization algorithm, that can # optimize initialization operations by batching them. # Some normalizers may be incompatible. # Disabled by default. implicit_breadth_first: false # When using the breadth-first normalization algorithm (see above), # only normalize each object once in each normalized graph. # An object that appears at several places will have its extra # properties merged into the first normalized instance, and the # other instances will be replaced by stubs. # Disabled by default. implicit_merge_objects: false # Automatically provides metadata consumers with information # obtained by using Symfony's PropertyInfo component and serializer # metadata, Doctrine's mappings, and attributes. # Enabled by default. auto_metadata: true # Parameters to use in the (de)serialization context of the services # defined by enabling the above features. # Null by default, which is treated the same as an empty mapping. default_context: ~ unsafe_features: # Optimizes Doctrine collection initializations by batching them. # Disabled by default. collection_batching: false # Optimizes Doctrine entity proxy initializations by batching them. # Disabled by default. entity_batching: false
exsyst/normalizer-extra-bundle 适用场景与选型建议
exsyst/normalizer-extra-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.36k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 11 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 exsyst/normalizer-extra-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 exsyst/normalizer-extra-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 3.36k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-11-10