-
-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JMSSerializerBundle configuration Metadata #536
Comments
@doums Did you ever got it working? I have a similar problem. |
@doums @sanderfreshheads same problem too with the yaml metadata file, it seems the node properties is not working at all... Did you found something? |
Hello, we detect the same issue on Symfony4, we try to put the configuration of jms directly in the framework.yaml file with this configuration and also in the jms configuration file but with the same result. jms_serializer:
visitors:
xml:
format_output: '%kernel.debug%'
metadata:
directories:
configuration-database:
namespace_prefix: "App\\Entity"
path: "%kernel.root_dir%/../src/Resources/serializer" JMS don't recognize where to find the yaml entity configuration. If there isn't any solution where could we start to find a soluton on this issue? One more thing, all works if I use notation with @ but we don't like this method, we would like to have the configuration file separatly. Thank you, regards |
@acando14 same problem too with the yaml metadata file ! I have create a new jms_serializer.yaml in config/package/ and I am getting even when i put the content(same as yours) in famework.yaml `There is no extension able to load the configuration for jms_serializer' Have you got something? |
@paulpascal well I don't have this error, i receive, when I try to run my tests Where Database is an entity of my project, and projectName a field of the class. If you want you could use the notations like this use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;
class Database
{
/**
* @var string
* @SerializedName("project_name")
* @Type("string")
*/
protected $projectName;
/**
* @var string
* @SerializedName("database")
* @Type("string")
*/
protected $database;
/**
* @var string
* @SerializedName("host")
* @Type("string")
*/
protected $host;
/**
* @var integer
* @SerializedName("port")
* @Type("integer")
*/
protected $port; and so on.... |
check if the bundle is loaded in @acando14
|
@goetas |
JMS Serializer looks for |
@goetas @leevigraham Does someone use yml/jms/symfony4 ? |
if |
@goetas path: "%kernel.root_dir%/../src/Resources/serializer" it is a bad practise but it is the same of path: "%kernel.root_dir%/Resources/serializer" Well I know that is a very bed path 😅 ... sorry... |
I had a similar issue with metadata directories not being registered in Symfony 4. To fix I had to remove the double backslash on the 'namespace_prefix' entries.
|
What if serializer does not load yml file from bundles Resources? Also, I've tried to change Additional info: Symfony 3.3, MyBundle is in vendor dir and jms serializer configuration in |
@leevigraham do you mean that I should use |
for some debug strategy, have a look how we found the solution for #650 |
Same here, Symfony 3.4 + FOSUserBundle. Exception: Contents of jms_serializer.yaml
file path from site root: \src\Resources\serializer\Model.User.yml Contents:
|
Where does JMS Serializer look for |
@domagoj03 There is no default directory, you have to configure it using the |
I try something similar to change the serializer of ExceptionHandler. So far in vain. The idea is to overwrite the default by FOS Rest, but I couldn't find how to do it with Symfony 4. |
Please refer to this commit for the updated documentation 6f45a52. This is a common issue and always was just a typo in the path, namespace (good YAML escaping rules...) or file extension. If no attempts allowed to find the typo, as ultimate resource, just print the value of If this line gets never invoked, most probably you did not clear the cache in between of config changes, so please clear the cache. |
Symfony 3.1.7 + FOSRestBundle latest version + JMSSerializerBundle latest version
my files :
app/config/config.yml
controller
entity
config
But the rules of this configuration file are not applied because I get this response :
What's wrong ?
Nota: When I use the Groups annotations (directly in the entity) the serializer works perfectly.
The text was updated successfully, but these errors were encountered: