MetaView icon indicating copy to clipboard operation
MetaView copied to clipboard

Objects in sealed class are not generated

Open yandroidUA opened this issue 4 years ago • 2 comments

Thanks for awesome tool. Sealed class:

@Serializable
sealed class ErrorDTO {

   @Serializable
   @SerialName(Reason.WRONG_LOGIN_LENGTH)
   data class WrongLoginLength(
      @SerialName("count") val count: Int,
      @SerialName("minCount") val minCount: Int,
      @SerialName("maxCount") val maxCount: Int
   ) : ErrorDTO()

   @Serializable
   @SerialName(Reason.RUNTIME_EXCEPTION)
   data class UnknownException(
      @SerialName("message") val message: String? = null
   ) : ErrorDTO()

   @Serializable
   @SerialName(Reason.USER_NOT_FOUND)
   object UserNotFound : ErrorDTO()

   @Serializable
   @SerialName(Reason.FILE_NOT_FOUND)
   object FileNotFound : ErrorDTO()

   @Serializable
   @SerialName(Reason.WHO_AND_TO_ARE_SAME)
   object WhoAndToAreSame : ErrorDTO()

   @Serializable
   @SerialName(Reason.UNAUTHORIZED)
   object UnAuthorize : ErrorDTO()

   @Serializable
   @SerialName(Reason.INVALID_EMAIL)
   object InvalidEmail : ErrorDTO()

   @Serializable
   @SerialName(Reason.EMPTY_PASSWORD)
   object EmptyPassword : ErrorDTO()

   @Serializable
   @SerialName(Reason.PASSWORDS_NOT_MATCH)
   object PasswordsNotMatch : ErrorDTO()

   @Serializable
   @SerialName(Reason.USER_WITH_THAT_LOGIN_ALREADY_EXIST)
   object UserWithThatLoginAlreadyExists : ErrorDTO()

   @Serializable
   @SerialName(Reason.OPERATION_NOT_PERMITTED)
   object OperationNotPermitted : ErrorDTO()

   @Serializable
   @SerialName(Reason.CONTENT_NOT_FOUND)
   object ContentNotFound : ErrorDTO()

   @Serializable
   @SerialName(Reason.LESSON_NOT_FOUND)
   object LessonNotFound : ErrorDTO()

   @Serializable
   @SerialName(Reason.COURSE_NOT_FOUND)
   object CourseNotFound : ErrorDTO()

   @Serializable
   @SerialName(Reason.GROUP_NOT_FOUND)
   object GroupNotFound : ErrorDTO()

   @Serializable
   @SerialName(Reason.SUBSCRIPTION_NOT_FOUND)
   object SubscriptionNotFound : ErrorDTO()

}

Generated diagram: image

yandroidUA avatar May 18 '21 14:05 yandroidUA

It looks like I'm not parsing objects at all... I'll see about adding another listener.

xcporter avatar May 18 '21 17:05 xcporter

Objects are now parsed in 0.0.5--I've included methods and properties by default since Objects so often get used as namespaces for utility functions. At some point, I'm going to have to add more granularity for including/ignoring elements.

xcporter avatar May 22 '21 05:05 xcporter