-
Notifications
You must be signed in to change notification settings - Fork 37
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
Nested attributes don't serialize correctly #131
Comments
Saule mimics Ember Data behavior here, which is arguably a better fit for JavaScript than C#. 'Complex' attributes are not touched. The reason it works with camel cased fields is that JSON.Net automaticallly handles those. Is there a particular reason you don't want to serialize these fields as a relationship instead? I don't have any particular objections to adding support for this in Saule, but I'm not sure it is needed. |
The only reason would be for 'value objects', i.e. things that are not considered as whole resources (deserving of an id and specific routes). Of course in this case I could just put everything on the top level and parse it in the appropriate hierarchy in my controllers, but what if I have an array of nested stuff with dashed names? And also, that may not be as important to everybody, but I feel that flattening the attributes hierarchy would lessen the clarity of the body in some cases (let's say I have over 25 attributes to post at once, and for better comprehension there should be 'sections' in those attributes, you see my point?) |
I published a new pre-release with a fix for this problem. |
I have this body on a post:
I'm within my rights to do that, according to the json api constitution, but saule doesn't parse the nested dashed keys, it only works if they're camelCased (default web api behavior I guess)
The text was updated successfully, but these errors were encountered: