How to whitelist entities recognized by API Platform? #2418
Unanswered
SimonVanacco
asked this question in
Q&A
Replies: 1 comment
-
Use your own ResourceNameCollectionFactory and return an array with only what you want. Also I suggest to not do 1 entity === 1 resource. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi :)
I am currently adding API Platform to a very large symfony 6 project of ours.
This will necessitate that we review everyone of our hundreds of entities to configure serialization groups, authorization etc. We don't have the time to do that all at once.
Currently, the Swagger UI shows ALL my entities in the Schema section, some which have recursion issues and break everything. I don't need these entities.
As i need only a few entities to work with my API, is there a way to force API Platform to only "see" the entities I want it to, and ignore the hundreds of unneeded entities ?
Thanks !
(this is a duplicate of my Stackoverflow question, i will update all of them with the answer when it's found !)
Beta Was this translation helpful? Give feedback.
All reactions