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

Serialize Courier default values #284

Closed

Conversation

elin-coursera2
Copy link

Courier default values were not correctly being serialized to JSON because the previous Writes logic iterated through fields contained in the underlying DataMap, which would not include unset fields with default values. This PR addresses this issue by iterating through the fields declared in the record schema instead, and explicitly uses the default value if a field is unset and a default exists.

@sonarcloud
Copy link

sonarcloud bot commented Mar 18, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@@ -6,8 +6,6 @@ addSbtPlugin("org.coursera.courier" % "courier-sbt-plugin" % "2.1.4")

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1")

addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
Copy link
Author

Choose a reason for hiding this comment

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

I removed this because this dependency is so old that it was removed from Maven. There's a newer version at com.github.sbt:sbt-pgp:2.1.2, but it doesn't seem to be compatible with sbt 0.13.

I think this still works because it seems sbt 0.13 actually bundles a copy of the original com.jsuereth jar.

@elin-coursera2
Copy link
Author

This didn't actually seem to fix the issue when I tested it

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

3 participants