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

Refactor model validation #13

Closed
2 tasks done
DanielSchaffer opened this issue Oct 1, 2018 · 0 comments
Closed
2 tasks done

Refactor model validation #13

DanielSchaffer opened this issue Oct 1, 2018 · 0 comments
Labels
feature New feature or request
Milestone

Comments

@DanielSchaffer
Copy link
Contributor

DanielSchaffer commented Oct 1, 2018

The current validation scheme actually does two jobs:

  • "reconstituting" a model from a "lesser" state
  • "lesser" meaning plain JSON, a database representation, etc
  • converts JS primitives into Dandi types (e.g. Uuid, Url, etc)
  • converts complex objects into classes as determined by decorator

The goals of this change are:

  • decouple the "reconstitution" step from the validation
  • support for alternate discovery of property values (e.g. getting embedded values from HAL resources from the _embedded property)

This most likely means moving the "reconstitution" logic into @dandi/model, which will not be a problem after #12. Alternatively, use a new package (e.g. @dandi/model-builder)

@DanielSchaffer DanielSchaffer added the feature New feature or request label Oct 1, 2018
@DanielSchaffer DanielSchaffer added this to the v1.0.0 milestone Oct 1, 2018
DanielSchaffer added a commit that referenced this issue Oct 5, 2018
…dation; remove key/object mapping logic from @dandi/data and @dandi/data-pg

supports #13, #18
DanielSchaffer added a commit that referenced this issue Oct 5, 2018
DanielSchaffer added a commit that referenced this issue Oct 5, 2018
… to allow defining a different or more complex source for a member when constructing a model

supports #13
DanielSchaffer added a commit that referenced this issue Oct 5, 2018
…ation properties that read from the _embedded object

#13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant