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

dont allow nested objects that are not DomainObjects, use this knowledge to require DomainObject.nested is set when using serialize or getUniqueIdentifier #10

Closed
uladkasach opened this issue Sep 6, 2020 · 1 comment
Labels
pit-of-success Something that prevents bugs in common use cases

Comments

@uladkasach
Copy link
Member

if we do this, then we will guarantee that user can not use serialize or getUniqueProperties dangerously even without the linter specified in #7

this may also just be a good constraint to enforce on people in general. I.e., flatten your keys - or define a DomainObject for the thing you're bundling.

@uladkasach uladkasach added the pit-of-success Something that prevents bugs in common use cases label Sep 6, 2020
@uladkasach
Copy link
Member Author

we went as far as we could with this, by just throwing an error if the object having manipulation on it is either:

  • not a domain object
  • not a safe domain object (i.e., has nested, not specified objects at all)

we will not require users to define nested every time though - as they could easily just say they dont want to support serialize and getUniqueIdentifier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pit-of-success Something that prevents bugs in common use cases
Projects
None yet
Development

No branches or pull requests

1 participant