Skip to content

Commit 48d8dfb

Browse files
committed
add deprecated operation flag into info() function
1 parent 64d3e77 commit 48d8dfb

File tree

1 file changed

+5
-3
lines changed
  • src/main/kotlin/com/papsign/ktor/openapigen/route

1 file changed

+5
-3
lines changed

src/main/kotlin/com/papsign/ktor/openapigen/route/Info.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@ import com.papsign.ktor.openapigen.modules.RouteOpenAPIModule
77
import com.papsign.ktor.openapigen.modules.openapi.OperationModule
88

99
/**
10-
* Adds a summary and description for the endpoint being configured
10+
* Adds a summary, description and deprecation flag for the endpoint being configured
1111
*/
12-
fun info(summary: String? = null, description: String? = null) = EndpointInfo(summary, description)
12+
fun info(summary: String? = null, description: String? = null, deprecated: Boolean? = null) = EndpointInfo(summary, description, deprecated)
1313

1414
data class EndpointInfo(
1515
val summary: String? = null,
16-
val description: String? = null
16+
val description: String? = null,
17+
val deprecated: Boolean? = null
1718
) : OperationModule, RouteOpenAPIModule {
1819
override fun configure(apiGen: OpenAPIGen, provider: ModuleProvider<*>, operation: OperationModel) {
1920
operation.description = description
2021
operation.summary = summary
22+
operation.deprecated = deprecated
2123
}
2224
}

0 commit comments

Comments
 (0)