Skip to content

Remove write-through#6

Merged
n0900 merged 4 commits into
developmentfrom
feature/rmWrite
Jul 9, 2026
Merged

Remove write-through#6
n0900 merged 4 commits into
developmentfrom
feature/rmWrite

Conversation

@n0900

@n0900 n0900 commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Removes write-through as it is not necessary for our usecase and makes integrations with kotlinx serialization more difficult. Also very unclear ownership relationship, can create mixed serial formats in same json object etc.

@n0900
n0900 requested a review from JesusMcCloud June 30, 2026 13:13
@n0900 n0900 self-assigned this Jun 30, 2026

@JesusMcCloud JesusMcCloud left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

seems legit, but why compare Json instances?

Comment on lines +43 to +64
private fun Json.hasSameConfigurationAs(other: Json): Boolean {
val left = configuration
val right = other.configuration
return left.encodeDefaults == right.encodeDefaults &&
left.ignoreUnknownKeys == right.ignoreUnknownKeys &&
left.isLenient == right.isLenient &&
left.allowStructuredMapKeys == right.allowStructuredMapKeys &&
left.prettyPrint == right.prettyPrint &&
left.explicitNulls == right.explicitNulls &&
left.prettyPrintIndent == right.prettyPrintIndent &&
left.coerceInputValues == right.coerceInputValues &&
left.useArrayPolymorphism == right.useArrayPolymorphism &&
left.classDiscriminator == right.classDiscriminator &&
left.allowSpecialFloatingPointValues == right.allowSpecialFloatingPointValues &&
left.useAlternativeNames == right.useAlternativeNames &&
left.namingStrategy == right.namingStrategy &&
left.decodeEnumsCaseInsensitive == right.decodeEnumsCaseInsensitive &&
left.allowTrailingComma == right.allowTrailingComma &&
left.allowComments == right.allowComments &&
left.classDiscriminatorMode == right.classDiscriminatorMode &&
left.exceptionsWithDebugInfo == right.exceptionsWithDebugInfo
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

WAT!

@n0900 n0900 Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

a StringFormat or JsonConfiguration is not a data class and thus uses referencial equality.
https://pl.kotl.in/vxGdhkoxK?theme=darcula

We could use .toString() for comparison instead

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤦

@n0900 n0900 mentioned this pull request Jul 1, 2026
@n0900
n0900 requested a review from JesusMcCloud July 6, 2026 10:14
@n0900
n0900 changed the base branch from feature/betterTypes to development July 8, 2026 12:28
@n0900
n0900 merged commit a3a1b99 into development Jul 9, 2026
13 of 20 checks passed
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