-
-
Notifications
You must be signed in to change notification settings - Fork 940
Closed
Description
We got an app where we would expose a referential for our users through our API (using APIP)
We have something like this:
/**
* @ApiResource
*/
abstract class FooReferential {
abstract public function getId(): string;
abstract public function getName(): string;
...
}
final class FooReferentialItem1 extends FooReferential {
...
}
final class FooReferentialItem2 extends FooReferential {
...
}Then we got a DataProvider where we inject all of this class and which allows to APIP to correctly get a collection.
Getting a collection works nicely, however other use cases does not work:
- Getting a single item seems to work weirdly: adding an
@id/@contexton some properties - When having another Resource that use one of those item, class resolver get the final class (the item) and not the parent class which is the correct resource class. So this fails to correctly convert the item to an iri item.
- Same as before when trying to post an entity with a reference to a referential item
I'm wondering if this is an use case that is supported or that you want to support: we want to expose a referential through an API where the data are in plain PHP (no Doctrine / Mongodb / ...)
IF that the case will do some PRS to try to support this is an better way in the future.