Skip to content

Conversation

@csantero
Copy link
Collaborator

closes #34

I took the opportunity to clean up that serializer integration test fixture file. The minification is now done inside the test, so if we need to modify the file, we won't go insane.

I also moved the minification utility into JSONAPI proper. The json sent from the client will now be minified during deserialization, before it reaches the ApiController. I could have gone either way on this one, but I felt that the format of the JSON during transit is no concern of the business layer. If it wants its JSON formatted in a certain way, it can deal with that itself after we are done with it.

@SphtKr
Copy link
Collaborator

SphtKr commented Jan 30, 2015

Will merge, but yeah, I'm not sure if the minification is our job--seems like if the user is doing something this "raw" it should be their job, or leave it to Json.NET (which probably wouldn't do anything to it, I don't think). On the other hand, I wonder if we shouldn't find some way to validate the (outgoing) JSON--if the JSON pulled from the persistence layer is malformed, the whole payload will be unparsable. That could even be an attack vector...though that might be paranoia.

SphtKr added a commit that referenced this pull request Jan 30, 2015
allow serialization of embedded raw json
@SphtKr SphtKr merged commit 824f8a9 into JSONAPIdotNET:master Jan 30, 2015
@csantero csantero deleted the raw-json branch January 30, 2015 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Serializing string fields with json data

2 participants