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

Fix Config serialization and empty Config serialization. #214

Merged
merged 2 commits into from Jan 31, 2020

Conversation

Arkatufus
Copy link
Contributor

  • Make serialization work using ISerializable
  • Resolve Config containing a single empty object as an empty Config

Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

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

One minor change, but otherwise looks great.

src/Hocon.Configuration/Config.cs Show resolved Hide resolved
@@ -42,8 +42,25 @@ public void ShouldSerializeHocon(string hocon, string fallback1, string fallback
private void VerifySerialization(Config config)
{
var serialized = JsonConvert.SerializeObject(config);
var deserialized = (Config)JsonConvert.DeserializeObject(serialized);
var deserialized = JsonConvert.DeserializeObject<Config>(serialized);
Copy link
Member

Choose a reason for hiding this comment

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

LOL - was this really as simple as just using the generic method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup... its just as simple as that

@Aaronontheweb Aaronontheweb added this to the v1.4.0 milestone Jan 31, 2020
@Aaronontheweb Aaronontheweb self-requested a review January 31, 2020 15:34
Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

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

LGTM

@Aaronontheweb Aaronontheweb merged commit 48a2267 into akkadotnet:dev Jan 31, 2020
@Aaronontheweb Aaronontheweb mentioned this pull request Feb 13, 2020
@Aaronontheweb Aaronontheweb removed this from the v2.0.1 milestone Feb 20, 2020
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