From 87b6d120ce2a539bef876da81d4fdce5ac99e836 Mon Sep 17 00:00:00 2001 From: Rodrigo Lazo Date: Thu, 3 Oct 2024 11:02:09 -0400 Subject: [PATCH] Use abstract class instead of sealed classes for StringFormat (#6334) `sealed` classes have nice properties but they don't play well with API backward compatibility. Adding a new class to a `sealed` class set is a breaking change since they require exhaustive switching. --- .../main/kotlin/com/google/firebase/vertexai/type/Schema.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/Schema.kt b/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/Schema.kt index f599e7d3b81..217f4442f76 100644 --- a/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/Schema.kt +++ b/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/Schema.kt @@ -16,8 +16,8 @@ package com.google.firebase.vertexai.type -public sealed class StringFormat(public val value: String) { - public class Custom(format: String) : StringFormat(format) +public abstract class StringFormat private constructor(internal val value: String) { + public class Custom(value: String) : StringFormat(value) } /** Represents a schema */