api-platform / api-platform/schema-generator

[enhancement] don't make abstract classes and embeddables api resources

未关闭
#72 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
PHP
星标
474
派生
107
PR 合并指标
30 天内没有已合并 PR

描述

Right now if I have this `schema.yml`

```yaml
types:
Thing:
properties:
name: ~

Person:
properties:
familyName: ~

Country:
parent: false
embeddable: true
properties:
address: { range: "Text" }

PostalAddress:
parent: false
properties:
addressCountry: { range: "Country", embedded: true }
```

It will generate all the entities and all entities are marked as an api resource in the class annotations. The only problem is that you don't want `Thing` and `Country` to be api resources. `Thing` is an abstract class so it can't even be initialized. And since `Country` is an embeddable it isn't linked to any database table so you can never fetch any countries from the api.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。