在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):cdimascio/kotlin-openapi-spring-functional-template开源软件地址(OpenSource Url):https://github.com/cdimascio/kotlin-openapi-spring-functional-template开源编程语言(OpenSource Language):Kotlin 55.3%开源软件介绍(OpenSource Introduction):kotlin-swagger-spring-functionalA project template for Kotlin Spring WebFlux. The template features automatic request validation and interactive API documentation using an OpenApi 3.0 or Swagger 2.0 specification. The template provides 12-factor compliant environment based config and integrated in linting. What's included?
Request validation and interactive documentation are based on an OpenApi 3.0 or Swagger v2 API specification. The specification is located at InstallClone this repo Build./gradlew build Run./gradlew run Lint## show lint errors
./gradlew lintKotlin
## Attempt to auto fix lint errors
./gradlew formatKotlin Test./gradlew test Dist./gradlew clean distZip Output artifact located at or unpacked ./gradlew clean distZip unzip Output artifact located at Run the standalone distCreate an unpacked dist. See the Dist section above. Then run it cp build/unpacked/dist $HOME/kotlin-swagger-spring-functional-1.0.0/bin/kotlin-swagger-spring-functional
Try It!Run the app or run the standalone dist, then: curl http://localhost:8080/api/users Try the example endpoints (with swagger validation)POST to curl -X POST http://localhost:8080/api/users -H "Content-Type: application/json" -d '{ "firstname": "carmine", "lastname": "dimascio" }' result {
"firstname":"carmine",
"lastname":"dimascio"
} POST to curl -X POST http://localhost:8080/api/users -H "Content-Type: application/json" -d '{ "firstname": "carmine" }' result {
"errors":[{
"code":"bad_request",
"message":"Object has missing required properties ([\"lastname\"])"}
]} Try the Interactive API documentationNavigate to http://localhost:8080
Contributors |
Katie Levy |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论