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

🐛 [cloud_firestore_odm] json_serializable's field property ignore doesn't work for getters #9419

Closed
bsr203 opened this issue Aug 24, 2022 · 2 comments · Fixed by #9766
Closed
Assignees
Labels
plugin: odm resolution: fixed A fix has been merged or is pending merge from a PR. type: bug Something isn't working

Comments

@bsr203
Copy link

bsr203 commented Aug 24, 2022

Hello,

This pr add support to ignore properties.

below getter

  @JsonKey(ignore: true)
  String get documentId {
    assert(id != null);
    return id!;
  }

still adds these entries (twice)

  XYZQuery whereDocumentId({
 ...
   XYZQuery orderByDocumentId({
...

using as below works.

  @JsonKey(ignore: true)
  String? documentId;
@bsr203 bsr203 added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Aug 24, 2022
@darshankawar darshankawar added the triage Issue is currently being triaged. label Aug 25, 2022
@darshankawar
Copy link

/cc @rrousselGit

@darshankawar darshankawar added plugin: odm and removed Needs Attention This issue needs maintainer attention. triage Issue is currently being triaged. labels Aug 25, 2022
@rrousselGit rrousselGit self-assigned this Oct 20, 2022
@rrousselGit
Copy link
Contributor

Looking at this issue, do we even want to support getters?

Since getters are not available in the Firestore DB, I don't see how doing something like whereMyGetter(..) would ever be useful.

So rather than applying JsonKey(ignore: true) to getters, wouldn't it make more sense to ignore all getters entirely?
They aren't present in the JSON after-all.

rrousselGit added a commit that referenced this issue Oct 20, 2022
The ODM used to generate methods such as `whereHashCode`

closes #9419
rrousselGit added a commit that referenced this issue Oct 20, 2022
…s. (#9766)

The ODM used to generate methods such as `whereHashCode`

closes #9419
@darshankawar darshankawar added the resolution: fixed A fix has been merged or is pending merge from a PR. label Oct 21, 2022
@firebase firebase locked and limited conversation to collaborators Nov 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
plugin: odm resolution: fixed A fix has been merged or is pending merge from a PR. type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants