Skip to content

Commit

Permalink
tie protocol versions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ghubertpalo committed Nov 14, 2022
1 parent 1f7973f commit 9cfe357
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mithril-aggregator/src/http_server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
4 changes: 4 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
@@ -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: |
Expand Down

0 comments on commit 9cfe357

Please sign in to comment.