From 9cfe357ff23d8e1a350c3d6402e954ad47073cdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20HUBERT=20/=20PALO-IT?= Date: Tue, 25 Oct 2022 11:11:43 +0200 Subject: [PATCH] tie protocol versions The protocol version is indicated in the `openapi.yml` file must also be up to date at compile time in the Rust source code. For now, a comment to link the Rust constant to the YAML version has been made. --- mithril-aggregator/src/http_server/mod.rs | 6 +++++- openapi.yaml | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mithril-aggregator/src/http_server/mod.rs b/mithril-aggregator/src/http_server/mod.rs index 67a702330af..1e3ad452f11 100644 --- a/mithril-aggregator/src/http_server/mod.rs +++ b/mithril-aggregator/src/http_server/mod.rs @@ -3,4 +3,8 @@ mod server; pub use server::{Server, SERVER_BASE_PATH}; -pub const MITHRIL_API_VERSION: &str = "0.1.0"; +/// Mithril API protocol version +/// this is the same as the one in openapi.yml file. +/// If you want to update this version to reflect changes in the protocol, +/// please also update the entry in the openapi.yml +pub const MITHRIL_API_VERSION: &str = "0.0.1"; diff --git a/openapi.yaml b/openapi.yaml index d96897da9b2..4ae65287a63 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1,5 +1,9 @@ openapi: "3.0.0" info: + # The protocol version is embedded in the code as constant in the + # `mithril-aggregator/src/http_server/mod.rs` file. If you plan to update it + # here to reflect changes in the API, please also update the constant in the + # Rust file. version: 0.0.1 title: Mithril Aggregator Server description: |