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

Break schemaController dependency. #1901

Merged

Conversation

drew-gross
Copy link
Contributor

Break more dependencies on schemaController.
Also most some validation out of the adapter and into the server.

expected = schema.getExpectedType(className, key);
}
if ((expected && expected.type == 'Pointer') || (!expected && restValue && restValue.__type == 'Pointer')) {
if ((parseFormatSchema.fields[key] && parseFormatSchema.fields[key].type === 'Pointer') || (!parseFormatSchema.fields[key] && restValue && restValue.__type == 'Pointer')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be worth null checking parseFormatSchema and parseFormatSchema.fields

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part of the contract we are going to make with the DB adapters is that we always provide a valid schema. All validation is going to happen inside Parse Server, so if those are ever null, we should actually crash and not just go forward without knowing what the real schema is.

@peterdotjs peterdotjs merged commit c9a138d into parse-community:master May 25, 2016
@drew-gross drew-gross deleted the object-update-into-mongo-adapter branch May 25, 2016 00:31
maninga added a commit to maninga/parse-server that referenced this pull request May 26, 2016
* upstream/master: (63 commits)
  Fixes parse-community#1649 (parse-community#1650)
  Update issue template (parse-community#1899)
  Break schemaController dependency. (parse-community#1901)
  Remove unnecessary null check
  Update schema mismatch error to include type string (parse-community#1898)
  Move more mongo specific stuff into mongo adapter
  Kill mongoOptions
  Consistent parameter order
  move transformWhere into mongo adapter
  Remove options from count
  Can't sort a count
  Remove limit from count
  Destructure mongo options
  remove adaptive collection call
  create + use adapter count instead of collection count
  transformWhere in MongoAdapter
  remove schemaController paramater
  Remove schemaController parameter
  Remove getRelationFields
  Remove all dependencies on schemaController
  ...
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.

None yet

2 participants