papsign/Ktor-OpenAPI-Generator
Fork: 42 Star: 244 (更新于 2024-11-27 17:26:17)
license: Apache-2.0
Language: Kotlin .
Ktor OpenAPI/Swagger 3 Generator
最后发布版本: 0.3-beta.3 ( 2022-06-19 06:07:14)
Ktor OpenAPI Generator
The Ktor OpenAPI Generator is a library to automatically generate the descriptor as you route your ktor application.
Ktor OpenAPI Generator is:
- Modular
- Strongly typed
- Explicit
Currently Supported:
- Authentication interoperability with strongly typed Principal (OAuth only, see TestServer in tests)
- Content Negotiation interoperability (see TestServer in tests)
- Custom response codes (as parameter in
@Response
) - Automatic and custom content Type routing and parsing (see
com.papsign.ktor.openapigen.content.type
, Binary Parser and default JSON parser (that uses the ktor implicit parsing/serializing)) - Exception handling (use
.throws(ex) {}
in the routes with an APIException object) with Status pages interop (with .withAPI in the StatusPages configuration) - tags (
.tag(tag) {}
in route with a tag object, currently must be an enum, but may be subject to change) - Spec compliant Parameter Parsing (see basic example)
- Legacy Polymorphism with use of
@DiscriminatorAnnotation()
attribute and sealed classes
Extra Features:
- Includes Swagger-UI (enabled by default, can be managed in the
install(OpenAPIGen) { ... }
section)
Examples
Take a look at a few examples
Who is using it?
And others... (add your name above)
Installation
Gradle
Step 1. Add the JitPack repository to your build file:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency:
dependencies {
implementation 'com.github.papsign:Ktor-OpenAPI-Generator:-SNAPSHOT'
}
Git Submodule
Install the submodule:
git submodule add https://github.com/papsign/Ktor-OpenAPI-Generator.git openapigen
Declare the folder in settings.gradle:
...
include 'openapigen'
Declare the dependency in the main build.gradle
apply plugin: 'kotlin'
...
dependencies {
compile project(":openapigen")
...
}
最近版本更新:(数据更新于 2024-09-19 18:34:15)
2022-06-19 06:07:14 0.3-beta.3
2021-11-05 20:09:45 0.3-beta.2
2021-11-03 00:54:41 0.3-beta.1
2021-07-24 06:00:18 0.2-beta.20
2021-07-20 22:52:28 0.2-beta.19
2021-05-26 19:42:48 0.2-beta.18
2021-05-26 19:35:47 0.2-beta.17
2021-03-18 00:01:07 0.2-beta.16
2021-03-09 02:28:52 0.2-beta.15
2021-03-01 00:33:31 0.2-beta.14
主题(topics):
kotlin, ktor, ktor-framework, ktor-openapi-generator, openapi, openapi-generator, swagger, swagger-ui
papsign/Ktor-OpenAPI-Generator同语言 Kotlin最近更新仓库
2024-12-20 11:28:10 Mygod/VPNHotspot
2024-12-17 22:50:27 mudkipme/MoeMemosAndroid
2024-12-17 15:04:09 gotson/komga
2024-12-15 18:02:25 MatsuriDayo/NekoBoxForAndroid
2024-12-14 17:50:54 avluis/Hentoid
2024-12-13 19:06:45 EhViewer-NekoInverter/EhViewer