Skip to content

Commit af81241

Browse files
author
Matthew Hawkins
authored
Add binary to output JSON schema for config (#202)
1 parent f97e7af commit af81241

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

crates/apollo-mcp-server/Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version.workspace = true
44
authors.workspace = true
55
edition = "2024"
66
license-file = "../LICENSE"
7+
default-run = "apollo-mcp-server"
78

89
[dependencies]
910
anyhow = "1.0.98"
@@ -43,3 +44,12 @@ tracing-test = "0.2.5"
4344

4445
[lints]
4546
workspace = true
47+
48+
[[bin]]
49+
name = "apollo-mcp-server"
50+
path = "src/main.rs"
51+
52+
[[bin]]
53+
name = "config-schema"
54+
path = "src/config_schema.rs"
55+
test = false
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//! Binary to output the JSON Schema for Apollo MCP Server configuration files
2+
3+
// Most runtime code is unused by this binary
4+
#![allow(unused_imports, dead_code)]
5+
6+
use anyhow::Context;
7+
use schemars::schema_for;
8+
9+
mod runtime;
10+
11+
fn main() -> anyhow::Result<()> {
12+
println!(
13+
"{}",
14+
serde_json::to_string_pretty(&schema_for!(runtime::Config))
15+
.with_context(|| "Failed to generate schema")?
16+
);
17+
Ok(())
18+
}

0 commit comments

Comments
 (0)