Skip to content

Fix issue: Id is null when anon. type is de/-serialized#2433

Merged
mbdavid merged 1 commit intolitedb-org:masterfrom
JKamsker:anonymous_type_deserialization_fix
Feb 21, 2024
Merged

Fix issue: Id is null when anon. type is de/-serialized#2433
mbdavid merged 1 commit intolitedb-org:masterfrom
JKamsker:anonymous_type_deserialization_fix

Conversation

@JKamsker
Copy link
Collaborator

Anonymous types get their _id zeroed out when deserializing.

@mbdavid mbdavid merged commit f856062 into litedb-org:master Feb 21, 2024
@mbdavid
Copy link
Collaborator

mbdavid commented Feb 21, 2024

Thanks @JKamsker

@JKamsker
Copy link
Collaborator Author

JKamsker commented Feb 21, 2024

Thanks for the Switft merge 🚀

Just one thing:
Was this even the correct approach?
Is this the way it's done in the other places?
I didnt find it, that's why i am asking.

I am:

  • Deserializing "Id"
  • If it is null, then check if _id is there and deserialize that

But it could also be:

  • If par.Name == Id then deserialize _id

Just not completely sure what the convention here is 😅

@JKamsker JKamsker deleted the anonymous_type_deserialization_fix branch September 20, 2025 11:58
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