Skip to content

Commit

Permalink
feat: PayloadDocumentationExtension 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
belljun3395 committed Jun 13, 2024
1 parent 1f6397a commit 1c0532c
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.few.api.web.controller.helper

import org.springframework.restdocs.payload.FieldDescriptor
import org.springframework.restdocs.payload.JsonFieldType

fun FieldDescriptor.fieldWithObject(description: String): FieldDescriptor {
return this.type(JsonFieldType.OBJECT).description(description)
}

fun FieldDescriptor.fieldWithArray(description: String): FieldDescriptor {
return this.type(JsonFieldType.ARRAY).description(description)
}

fun FieldDescriptor.fieldWithString(description: String): FieldDescriptor {
return this.type(JsonFieldType.STRING).description(description)
}

fun FieldDescriptor.fieldWithNumber(description: String): FieldDescriptor {
return this.type(JsonFieldType.NUMBER).description(description)
}

fun FieldDescriptor.fieldWithBoolean(description: String): FieldDescriptor {
return this.type(JsonFieldType.BOOLEAN).description(description)
}

fun FieldDescriptor.fieldWithNull(description: String): FieldDescriptor {
return this.type(JsonFieldType.NULL).description(description)
}
class PayloadDocumentationExtension

0 comments on commit 1c0532c

Please sign in to comment.