Skip to content

octogene/openapi-diff-gradle

Repository files navigation

OpenAPI Diff Gradle plugin 🐘

Pre Merge Checks License Language

A simple Gradle Plugin 🐘 to generate an OpenAPI diff from git tags and integrate it to your changelog.

How to use 👣

Apply the plugin

// build.gradle.kts
plugins {
    id("dev.octogene.openapidff") version "0.1.0"
}

Configure the plugin

openapiDiff {
    targetFile = "${project.projectDir}/doc/openapi/petstore.yaml"
    // Optional (will use targetFile as default)
    baseFile = "${project.projectDir}/petstore.yaml"
    baseTag = "example-1.0.0"
    outputFile = "${project.projectDir}/CHANGELOG.md"
    // Optional
    section = "### OpenAPI"
    // Optional (will use HEAD as default target)
    targetTag = "example-1.0.2"
}

Features 🎨

  • Generate openapi diff from tags
  • Insert diff at a section in markdown or asciidoc document

Example

You can try to use directly the plugin with the example project by running:

./gradlew :example:patchOpenAPIDiff

Or you can use the task from the Gradle Changelog Plugin we hooked with our custom task :

./gradlew :example:patchChangelog

Contributing 🤝

Feel free to open a issue or submit a pull request for any bugs/improvements.

License 📄

This project is licensed under the MIT License - see the License file for details. This project is using the kotlin-gradle-plugin-template by Nicola Corti. Use the same template

About

OpenAPI Diff Changelog Generator (Gradle Plugin)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages