Skip to content

Commit

Permalink
refactor : Modified to display enum values more clearly.
Browse files Browse the repository at this point in the history
  • Loading branch information
wwan13 committed Jul 31, 2024
1 parent 9b87a24 commit e15b3de
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ infix fun <T : Enum<T>> String.isTypeOf(enumType: ENUM<T>): DocumentField {
return DocumentField(
identifier = this,
type = enumType,
enumValues = " (${enumType.entries.joinToString(", ")})"
enumValues = enumType.entries.toString()
)
}

Expand All @@ -28,12 +28,12 @@ data class DocumentField(
val type: FieldType,
var description: String = "",
var required: Boolean = true,
val enumValues: String? = null
val enumValues: String = ""
) {
fun toFieldDescriptor(): FieldDescriptor {
val descriptor = PayloadDocumentation.fieldWithPath(identifier)
.type(type.value)
.description(description + enumValues)
.description(description)
if (!required) {
descriptor.optional()
}
Expand Down

0 comments on commit e15b3de

Please sign in to comment.