rebolon / apijsonparamconvertercomponent Goto Github PK
View Code? Open in Web Editor NEWParamConverter to build entities from json string catched in Request (#symfony, #api-platform)
ParamConverter to build entities from json string catched in Request (#symfony, #api-platform)
For instance, only Insert operation are allowed. Why ?
Because the ParamConverter is only allowed to restore valid Entities. And it considers that if there is an identifier property (id by default), it must retreive the real entity from database.
So it cuts all other fields and use database information.
But there is 2 problems:
The question would be: what is the expected behavior ?
should we provide different ParamConverter ? one for Insert, one for Update ?
when there is ID, should we retreive from database, and then apply modification from json ? but in that case for all properties undefined in Json, should we set them to null in retreived Entity ? and for properties that are list of entities (for the repsresentation of associative table) should we remove existing entries and add those defined in Json ? Because when we retreive information from database, don't forget that Doctrine will manage relations so it might add new relations
For instance for a Book i must have a root book node like this:
{
book: {
...
}
}
This is useless and so it should be optional ! (ApiPlatform with Denormalizer doesn't need this root node)
It should be better than doing it by myself.
I will just need to keep the deduplication system that is the keypoint of this package
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.