Skip to content
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

Spray JSON Support : createEntityFromJson with missing fields #169

Open
alexd6631 opened this issue Feb 18, 2015 · 0 comments
Open

Spray JSON Support : createEntityFromJson with missing fields #169

alexd6631 opened this issue Feb 18, 2015 · 0 comments

Comments

@alexd6631
Copy link

createEntityFromJson allows you construct entity with missing "required" fields in the JSON

For instance given the following model :

class Person(var firstName: String,
              var lastName: String,
              var age: Int) extends Entity

it is possible to create an entity with the json data :

{ "firstName": "alex", "lastName" : "test"}

However, the entity will be in a very inconsistent state. A more appropriate behaviour would be to reproduce the logic in EntityMap.createEntityUsingConstructor, ie preventing creation of entity if no matching constructor is found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants