symfony / symfony/maker-bundle

Regenerate entity with api-resource flag

Open
#377 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
3.4k
Forks
427
Avg merge
2d 22h
Merged PRs (30d)
20

Description

Hello.
Thank you for integration of API Platform in make:entity command. Probably I have some specific case, but I would like to know how to treat or to fix it.

I'm doing reverse engineering with DB schema. I crate tables through MySQL Workbench. After that I run next command to create entity with properties for tables in DB:

bin/console doctrine:mapping:import "App\Entity" annotation --path=src/Entity

And the next step is command:

bin/console make:entity --regenerate App

This command generates getters/setter in entity class, but if I try to add --api-resource flag, it is simply ignored and I have to add annotation @ApiResource manually.

Do you have any ideas how to treat this case? I'm also able to contribute it, if any work is required 🙂

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the make:entity command and its --regenerate path, then compare how --api-resource is handled during entity creation versus regeneration. Reproduce the commands from the issue with the Doctrine mapping import, and verify that regeneration applies the API resource annotation when the flag is supplied.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.