papsign/Ktor-OpenAPI-Generator
Fork: 42 Star: 243 (更新于 2024-11-05 02:40:43)
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-11-19 23:12:26 jellyfin/jellyfin-androidtv
2024-11-18 20:14:29 gkd-kit/gkd
2024-11-11 21:37:35 FooIbar/EhViewer
2024-11-01 20:22:27 EhViewer-NekoInverter/EhViewer
2024-11-01 16:15:30 tiann/KernelSU
2024-10-27 19:26:53 salvogiangri/KnoxPatch