Skip to content

Ability to ignore constructor class map #686

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

Conversation

georgesjamous
Copy link

Adds the ability to ignore classMap when creating object. Object will be returned as an instance of ParseObject if ignoresClassMap is set to true.

My use case is i need to load a Session object from an already exported json object.
Parse.Object.fromJson({ className: '_Session', sessionToken: "r:123..", ...otherStuff })
Currently this will throw an error preventing readonly keys from being edited.

This should be safe since most restrictions are aleady being checked in server side.

@codecov
Copy link

codecov bot commented Oct 24, 2018

Codecov Report

Merging #686 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #686   +/-   ##
=======================================
  Coverage   85.69%   85.69%           
=======================================
  Files          48       48           
  Lines        3880     3880           
  Branches      882      884    +2     
=======================================
  Hits         3325     3325           
  Misses        555      555
Impacted Files Coverage Δ
src/ParseObject.js 88.48% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0cc4978...976db24. Read the comment docs.

@flovilmart
Copy link
Contributor

Those features have a purpose I believe and I am not for mutating them not changing them.

I am not sure this is a change we want in the SDK, nor why it is necessary to change.

What alternatives did you consider?
What is the target goal, bigger picture?

@georgesjamous
Copy link
Author

Its for something unrelated, I was checking the feasibilty of a readonly hook on _Session class in parse-server repo, it was failing becuase of ParseSession readonly key override, which was throwing error.

Anyway, i might have found another way.
Closing this, will reopen if needed with additional explanation.

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.

2 participants