-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
101 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
schema-kenerator-test/src/test/kotlin/io/github/smiley4/schemakenerator/test/Test.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.github.smiley4.schemakenerator.test | ||
|
||
import io.github.smiley4.schemakenerator.serialization.processKotlinxSerialization | ||
import io.github.smiley4.schemakenerator.swagger.compileInlining | ||
import io.github.smiley4.schemakenerator.swagger.data.TitleType | ||
import io.github.smiley4.schemakenerator.swagger.generateSwaggerSchema | ||
import io.github.smiley4.schemakenerator.swagger.withAutoTitle | ||
import io.swagger.v3.oas.models.media.Schema | ||
import kotlinx.serialization.Serializable | ||
import kotlin.reflect.typeOf | ||
|
||
@Serializable | ||
class MyExampleClass( | ||
val someText: String, | ||
val someNullableInt: Int?, | ||
val someBoolList: List<Boolean>, | ||
) | ||
|
||
fun main() { | ||
|
||
val swaggerSchema: Schema<*> = typeOf<MyExampleClass>() | ||
.processKotlinxSerialization() | ||
.generateSwaggerSchema() | ||
.withAutoTitle(TitleType.SIMPLE) | ||
.compileInlining() | ||
.swagger | ||
|
||
println(swaggerSchema) | ||
|
||
} |