Skip to content
This repository was archived by the owner on Jun 26, 2026. It is now read-only.

Repository files navigation

ventrad

Maven Central Maven Central (snapshot) Codecov Java Version

com.io7m.ventrad

JVM Platform Status
OpenJDK (Temurin) Current Linux Build (OpenJDK (Temurin) Current, Linux)
OpenJDK (Temurin) LTS Linux Build (OpenJDK (Temurin) LTS, Linux)
OpenJDK (Temurin) Current Windows Build (OpenJDK (Temurin) Current, Windows)
OpenJDK (Temurin) LTS Windows Build (OpenJDK (Temurin) LTS, Windows)

Repository Relocation

Development of this project has moved to an open-source but not open-contribution model.

Source code and commits will remain publicly available perpetually, but issues and/or pull requests will be rejected and/or ignored. Additionally, this project will now only be available via a read-only mirror at:

https://codeberg.org/io7m-com/ventrad

ventrad

The ventrad package provides a JSON protocol for advertising HTTP endpoint protocol versions.

Features

  • Written in pure Java 17.
  • OSGi ready.
  • JPMS ready.
  • ISC license.
  • High-coverage automated test suite.

Description

ventrad is a trivial protocol for announcing a set of protocols exposed by a set of HTTP endpoints.

A client connecting to a root endpoint reads a JSON document delivered with the content type application/ventrad+json. The document details which protocols are supported by the given server, and instructs the client on where to go in order to use those protocols.

As an example:

$ curl https://api.example.com/
{
  "%Schema" : "urn:com.io7m.ventrad:1",
  "Protocols" : [ {
    "Id" : "urn:com.io7m.cardant:inventory",
    "VersionMajor" : 1,
    "VersionMinor" : 0,
    "Endpoint" : "/inventory/1/0/",
    "Description" : "Cardant Inventory service v1.0"
  }, {
    "Id" : "urn:com.io7m.cardant:inventory",
    "VersionMajor" : 1,
    "VersionMinor" : 1,
    "Endpoint" : "/inventory/1/1/",
    "Description" : "Cardant Inventory service v1.1"
  }, {
    "Id" : "urn:com.io7m.cardant:inventory",
    "VersionMajor" : 2,
    "VersionMinor" : 0,
    "Endpoint" : "/inventory/2/0/",
    "Description" : "Cardant Inventory service v2.0"
  } ]
}

The JSON document MUST include a %Schema property with a value of urn:com.io7m.ventrad:1.

The Protocols property is a non-null array of Protocol objects. A Protocol object contains a unique identifier for the protocol, a non-negative major and minor protocol version, a URI indicating the endpoint that uses the protocol, and a humanly-readable description of the protocol and the version. All fields are required and must be non-null.

Schema

The served document MUST conform to the given schema:

{
  "$schema" : "https://json-schema.org/draft/2020-12/schema",
  "$defs" : {
    "VProtocol" : {
      "type" : "object",
      "properties" : {
        "Description" : {
          "type" : "string",
          "description" : "A humanly-readable description of the protocol."
        },
        "Endpoint" : {
          "type" : "string",
          "format" : "uri",
          "description" : "The endpoint to be used by clients for this protocol."
        },
        "Id" : {
          "type" : "string",
          "description" : "The protocol identifier."
        },
        "VersionMajor" : {
          "type" : "integer",
          "description" : "The protocol major version."
        },
        "VersionMinor" : {
          "type" : "integer",
          "description" : "The protocol minor version."
        }
      },
      "required" : [ "Description", "Endpoint", "Id", "VersionMajor", "VersionMinor" ],
      "description" : "A single version of a single protocol."
    }
  },
  "type" : "object",
  "properties" : {
    "%Schema" : {
      "type" : "string"
    },
    "Protocols" : {
      "description" : "The protocols.",
      "type" : "array",
      "items" : {
        "$ref" : "#/$defs/VProtocol"
      }
    }
  },
  "required" : [ "%Schema", "Protocols" ],
  "description" : "A set of supported protocols in priority order."
}

About

JSON protocol for HTTP endpoint version announcements.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages