Skip to content

Spring Boot Service written in Kotlin to validate version ranges according to semver specification.

License

Notifications You must be signed in to change notification settings

kevcodez/semver-rest-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot Service written in Kotlin that offers a REST API for semantic versioning, built on Java SemVer.

Build Status Coverage Status

Installation

git clone
mvn clean install -DskipTests
java -jar ./target/semver-rest-api.jar

Visit http://localhost:8080/swagger-ui.html for REST API documentation.

API

Version information

GET /info/2.1.0-beta

{
  "major": 2,
  "minor": 1,
  "patch": 0,
  "preRelease": "beta",
  "normal": "2.1.0"
}

Version range validation

POST /validate

{
  "versionRange": "^1.0.0",
  "versionsToValidate": [
    "1.0.0",
    "1.1.0",
    "2.0.0",
    "3.0.0"
  ]
}
{
  "versionRange": "^1.0.0",
  "validatedVersions": {
    "2.0.0": false,
    "3.0.0": false,
    "1.0.0": true,
    "1.1.0": true
  }
}

GET /validate/1.0.0/inRange/^1.0.0 => 200 OK true

GET /validate/2.0.0/inRange/^1.0.0 => 200 OK false

Increment versions

The API offers endpoints to increment major, minor, patch and pre release version.

GET /increment/major/1.0.0

{
  "major": 2,
  "minor": 0,
  "patch": 0,
  "normal": "2.0.0"
}

API documentation

The API is documented using Swagger. You can access the Swagger-UI on /swagger-ui.html.

Releases

No releases published

Packages