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

Change zio.json.ast.Json from sealed abstract class to sealed trait #1011

Closed
wants to merge 1 commit into from

Conversation

987Nabil
Copy link
Contributor

There is no benefit, in having here an abstract class instead of a trait, as far as I can tell.
But for derivation in the zio-ecosystem, typically abstract class is not supported (zio-schema for example).
That's why I propose to change to sealed trait. The behaviour should not change at all in my opinion.

@987Nabil 987Nabil requested a review from a team as a code owner August 28, 2023 04:21
@guizmaii
Copy link
Member

IIRC, there's a bin compat issue with sealed trait. IIRC, @fommil knows that very well as it's in his book?

@fsvehla
Copy link
Contributor

fsvehla commented Aug 28, 2023

Yes, I think it would be an issue; we’d need to push 0.7

@fommil
Copy link
Contributor

fommil commented Aug 29, 2023

shouldn't the bug report be with other projects, that didn't consider this well-known pattern? This is like complaining that you want coke to change the shape of their bottle because it doesn't fit in your mini-fridge.

@987Nabil
Copy link
Contributor Author

I found another/better solution for this. I realised that deriving the schema won't work anyway. I'll add a custom schema to the json module of zio-schema.

@987Nabil 987Nabil closed this Aug 30, 2023
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.

4 participants