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

Record & Schema Classes #554

Open
crobinson42 opened this issue Jan 26, 2020 · 0 comments
Open

Record & Schema Classes #554

crobinson42 opened this issue Jan 26, 2020 · 0 comments
Labels
v4 discussion thoughts, concerns, ideas, etc. for changes intended for v4 release
Milestone

Comments

@crobinson42
Copy link
Member

The Record class is invoked to create a record instance, ie: recordInstance = store.add({ ... }). One of the limitations with v3 Record class is that it's not easily extended or changed to meet the needs of custom applications. One of these issues is the inability to do this on a record: JSON.stringify(record) and requires the method call record.toJSON() instead.

The Schema class is used on a Record instance to perform validations when the Mapper has a defined schema. https://www.js-data.io/docs/validation#section-defining-a-schema
The concerns with Schema:

  • It's an old json-schema hand-rolled spec (v4 json-schema)
  • It lacks the ability to easily extend custom validation logic (ie: Joi or AJV libs)
@crobinson42 crobinson42 added the v4 discussion thoughts, concerns, ideas, etc. for changes intended for v4 release label Jan 26, 2020
@crobinson42 crobinson42 added this to the 4.0.0 Release milestone Jan 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v4 discussion thoughts, concerns, ideas, etc. for changes intended for v4 release
Projects
None yet
Development

No branches or pull requests

1 participant