lube / api-generator-bundle
从 Doctrine 实体生成 REST API
0.2.0
2016-12-07 14:06 UTC
Requires
README
警告!该包现在处于开发阶段,不建议在生产环境中使用!
ApiGeneratorBundle 包允许您使用从 Doctrine 元数据、注解和 Symfony 验证组件派生的 JSON 模式,为您 doctrine 实体生成 JSON CRUD API。
文档
有关文档,请参阅
Resources/doc/
安装
通过 composer 安装
第一步:要求包
composer require lube/api-generator-bundle
第二步:启用包
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new JMS\AopBundle\JMSAopBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new JMS\DiExtraBundle\JMSDiExtraBundle($this), new Knp\JsonSchemaBundle\KnpJsonSchemaBundle(), new HadesArchitect\JsonSchemaBundle\JsonSchemaBundle(), new Nelmio\ApiDocBundle\NelmioApiDocBundle(), new Lube\GeneratorBundle\LubeGeneratorBundle(), ); }
使用方法
$ app/console api:generate:json $ app/console api:generate
API 端点现在可用,请检查生成的控制器并测试端点!
贡献
请参阅贡献文件。
致谢
设计灵感主要来自 Doctrine CRUD 生成器。
此包依赖于 JMSSerializer、JMSDiExtraBundle、NelmioApiDocBundle、JsonSchemaBundle。
许可证
此包在 MIT 许可证下发布。请参阅包中的完整许可证。
Resources/meta/LICENSE