Skip to content

Commit

Permalink
fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
SMILEY4 committed Jul 11, 2024
1 parent 32ed0df commit 076b9f0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import io.ktor.server.netty.Netty
import io.ktor.server.response.respond
import io.ktor.server.routing.route
import io.ktor.server.routing.routing
import sun.jvm.hotspot.oops.CellTypeState.value

fun main() {
embeddedServer(Netty, port = 8080, host = "localhost", module = Application::myModule).start(wait = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,38 @@ class SchemaConfig {


/**
* Overwrite the given [type] with the given [replacement]. When the type is specified as the type of a schema, the replacement is used instead.
* Overwrite the given [type] with the given [replacement].
* When the type is specified as the type of a schema, the replacement is used instead.
* This only works for "root"-types and not types of e.g. nested fields.
*/
fun overwrite(type: KType, replacement: TypeDescriptor) {
overwrite[type] = replacement
}

/**
* Overwrite the given type [T] with the given [replacement]. When the type is specified as the type of a schema, the replacement is used instead.
* Overwrite the given type [T] with the given [replacement].
* When the type is specified as the type of a schema, the replacement is used instead.
* This only works for "root"-types and not types of e.g. nested fields.
*/
inline fun <reified T> overwrite(replacement: TypeDescriptor) = overwrite(typeOf<T>(), replacement)

/**
* Overwrite the given type [T] with the given [replacement]. When the type is specified as the type of a schema, the replacement is used instead.
* Overwrite the given type [T] with the given [replacement].
* When the type is specified as the type of a schema, the replacement is used instead.
* This only works for "root"-types and not types of e.g. nested fields.
*/
inline fun <reified T> overwrite(replacement: Schema<*>) = overwrite(typeOf<T>(), SwaggerTypeDescriptor(replacement))

/**
* Overwrite the given type [T] with the given [replacement]. When the type is specified as the type of a schema, the replacement is used instead.
* Overwrite the given type [T] with the given [replacement].
* When the type is specified as the type of a schema, the replacement is used instead.
* This only works for "root"-types and not types of e.g. nested fields.
*/
inline fun <reified T> overwrite(replacement: KType) = overwrite(typeOf<T>(), KTypeDescriptor(replacement))

/**
* Overwrite the given type [T] with the given replacement [R]. When the type is specified as the type of a schema, the replacement is used instead.
* Overwrite the given type [T] with the given replacement [R].
* When the type is specified as the type of a schema, the replacement is used instead.
* This only works for "root"-types and not types of e.g. nested fields.
*/
inline fun <reified T, reified R> overwrite() = overwrite(typeOf<T>(), KTypeDescriptor(typeOf<R>()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ class OpenApiRoute {
var tags: Collection<String> = emptyList()

/**
* Set the list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier
* Set the list of tags for API documentation control.
* Tags can be used for logical grouping of operations by resources or any other qualifier
*/
fun tags(tags: Collection<String>) {
this.tags = tags
}

/**
* Set the list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier
* Set the list of tags for API documentation control.
* Tags can be used for logical grouping of operations by resources or any other qualifier
*/
fun tags(vararg tags: String) {
this.tags = tags.toList()
Expand Down

0 comments on commit 076b9f0

Please sign in to comment.