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

Mapping $id or $ref into properties. #44

Open
brandorf opened this issue Aug 31, 2023 · 1 comment
Open

Mapping $id or $ref into properties. #44

brandorf opened this issue Aug 31, 2023 · 1 comment

Comments

@brandorf
Copy link

I've got some inner objects that are using $id as property names that need to be mapped to an object. Normally I would modify the json serializer settings to ignore references, but this seems to not be exposed to us when using the Snowflake client?

Short version, given an object like so:
"emid": { "$id": "63484e6eab783af4c4072539" }

With a poco:

public class Emid { [JsonProperty("$id")] public string id { get; set; } }

In the final deserialized object coming back from QueryAsync, that ID will alway be null, is there a setting I'm overlooking?

@fixer-m
Copy link
Owner

fixer-m commented Sep 6, 2023

Hello! You can override json serializer options - you can pass them in SnowflakeClient constructor or you can set it directly with this method: SnowflakeDataMapper.SetJsonMapperOptions(jsonSerializerOptions).

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

No branches or pull requests

2 participants