Điểm qua Yelp/swagger-gradle-codegen: 409 sao trên GitHub, viết chủ yếu bằng Kotlin, thuộc nhóm Mobile. 💫 A Gradle Plugin to generate your networking code from Swagger
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
A Gradle plugin to generate networking code from a Swagger spec file.
This plugin wraps swagger-codegen, and exposes a configurable generateSwagger gradle task that you can plug inside your gradle build/workflows.
Getting Started
Swagger Gradle Codegen is distributed through Gradle Plugin Portal. To use it you need to add the following dependency to your gradle files.
Please note that those code needs to be added the gradle file of the module where you want to generate the code (not the top level build.gradle[.kts] file).
Please note that the generateSwagger { } block is needed in order to let the plugin work.
Once you setup the plugin correctly, you can call the :generateSwagger gradle task, that will run the code generation with the configuration you provided.
Requirements
In order to run this gradle plugin you need to fulfill the following requirements:
Gradle 6.x - This plugin uses Gradle 6 features, and you will need to setup your Gradle wrapper to use 6.8 or more.
Java 8+
Supported platforms
The Swagger Gradle Codegen is designed to support multiple platforms. For every platform, we provide templates that are tested and generates opinionated code.
Here the list of the supported platforms:
Platform
Description
kotlin
Generates Kotlin code and Retrofit interfaces, with RxJava2 for async calls and Moshi for serialization
kotlin-coroutines
Generates Kotlin code and Retrofit interfaces, with Kotlin Coroutines for async calls and Moshi for serialization
We're looking forward to more platforms to support in the future. Contributions are more than welcome.
Examples
You can find some examples in this repository to help you set up your generator environment.
samples/groovy-android Contains an example of an Android Library configured with a build.gradle file, using the classical Gradle/Groovy as scripting language.
samples/kotlin-android Contains an example of an Android Library configured with a build.gradle.kts file, using Kotlin as scripting language.
samples/kotlin-coroutines Contains an example of an Android Library configured to output Kotlin Coroutines capable code.
samples/junit-tests This sample contains specs used to test edge cases and scenarios that have been reported in the issue tracker or that are worth testing. Tests are executed using moshi-codegen.
It does also contains all the generated code inside the /scr/main/java folder. You can use this example to see how the generated code will look like (like here).
How the generated code will look like
Here you can find some examples of how the generated code will look like in your project.
Configuration
To configure the generator, please use the generateSwagger { } block. Here an example of this block with all the properties.
You can use the features { } block to specify customization or enabled/disable specific features for your generator.
Here a list of all the supported features:
Feature
Description
Command line
headersToRemove
List of headers that needs to be ignored for every endpoints. The headers in this list will be dropped and not generated as parameters for the endpoints.
-ignoreheaders=
Building
To contribute or to start developing the Swagger Codegen Plugin, you need to set up your environment.
Make sure you have:
Python (needed for pre-commit hook)
Java/Kotlin (needed for compiling the plugin code)
We also recommend you set up:
aactivator To correctly manage your venv connected to this project
IntelliJ IDEA Either the Community or the Ultimate edition are great to contribute to the plugin.
Before starting developing, please run:
./gradlew installHooks
This will take care of installing the pre-commit hooks to keep a consistent style in the codebase.
While developing, you can build, run pre-commits, checks & tests on the plugin using:
./gradlew preMerge
Make sure your tests are all green ✅ locally before submitting PRs.
NOTE: If you don't have the Android SDK you can skip the Android related tasks by setting SKIP_ANDROID enviromental variable (tests will be run on the CI anyway).
Contributing/Support
Support for this project is offered in the #swagger-gradle-codegen channel on the Kotlinlang slack (request an invite here).
We're looking for contributors! Feel free to open issues/pull requests to help me improve this project.
If you found a new issue related to incompatible Swagger specs, please attach also the spec file to help investigate the issue.
License 📄
This project is licensed under the Apache 2.0 License - see the License file for details
Yelp/swagger-gradle-codegen thuộc nhóm Mobile trên TopGit, cùng 13 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về Yelp/swagger-gradle-codegen ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/Yelp/swagger-gradle-codegen là nguồn chính thức.
Vì sao Yelp/swagger-gradle-codegen được xếp vào nhóm Mobile?
TopGit xếp Yelp/swagger-gradle-codegen vào nhóm Mobile dựa trên GitHub topics và mô tả của repo (gắn thẻ: "gradle", "gradle-plugin", "gradle-plugin-kotlin"). Việc phân loại dựa trên metadata thật của repo, không phải đoán theo cảm tính biên tập.
Yelp/swagger-gradle-codegen có bao nhiêu sao?
Yelp/swagger-gradle-codegen có 409 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/Yelp/swagger-gradle-codegen. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
Yelp/swagger-gradle-codegen còn đang phát triển không?
Commit gần nhất trên Yelp/swagger-gradle-codegen là 4 tháng trước (theo timestamp GitHub). Repo có 35 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Yelp/swagger-gradle-codegen viết bằng ngôn ngữ gì?
Yelp/swagger-gradle-codegen chủ yếu viết bằng Kotlin. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
swagger-gradle-codegen có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về swagger-gradle-codegen.