mirror of
https://github.com/telemt/telemt.git
synced 2026-11-22 07:16:38 +03:00
OpenAPI artifacts and preserve discovery contracts removed
This commit is contained in:
@@ -85,7 +85,6 @@ pub(super) struct CapabilitiesData {
|
||||
schema_version: u32,
|
||||
software_version: &'static str,
|
||||
config_schema: &'static str,
|
||||
openapi_artifact: &'static str,
|
||||
read_only: bool,
|
||||
availability_scope: &'static str,
|
||||
operations: Vec<OperationCapability>,
|
||||
@@ -199,7 +198,6 @@ fn build_capabilities(
|
||||
schema_version: SCHEMA_VERSION,
|
||||
software_version: env!("CARGO_PKG_VERSION"),
|
||||
config_schema: "/v1/config/schema",
|
||||
openapi_artifact: "docs/Architecture/API/openapi-v1.json",
|
||||
read_only: config.server.api.read_only,
|
||||
availability_scope: "feature_and_runtime_source_prerequisites_not_request_success",
|
||||
operations: entries,
|
||||
|
||||
@@ -127,11 +127,7 @@ fn example_path(path: &str) -> String {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn operation_catalog_matches_routing_methods_and_openapi() {
|
||||
let document: Value = serde_json::from_str(include_str!(
|
||||
"../../../docs/Architecture/API/openapi-v1.json"
|
||||
))
|
||||
.unwrap();
|
||||
fn operation_catalog_matches_routing_methods() {
|
||||
let mut paths = BTreeMap::<String, BTreeSet<String>>::new();
|
||||
let mut ids = BTreeSet::new();
|
||||
for operation in operations().unwrap() {
|
||||
@@ -153,11 +149,6 @@ fn operation_catalog_matches_routing_methods_and_openapi() {
|
||||
allowed.split(", ").any(|method| method == operation.method),
|
||||
"{path}: {allowed}"
|
||||
);
|
||||
let spec = &document["paths"][path][operation.method.to_lowercase()];
|
||||
assert!(spec.is_object(), "missing OpenAPI operation: {path}");
|
||||
for status in &operation.success {
|
||||
assert!(spec["responses"][status.to_string()].is_object());
|
||||
}
|
||||
}
|
||||
}
|
||||
for (path, methods) in &paths {
|
||||
@@ -168,7 +159,6 @@ fn operation_catalog_matches_routing_methods_and_openapi() {
|
||||
"{path}"
|
||||
);
|
||||
}
|
||||
assert_eq!(paths.len(), document["paths"].as_object().unwrap().len());
|
||||
// Both tables are independent: a newly dispatched fixed route cannot silently
|
||||
// disappear from discovery because a maintainer omitted its catalog entry.
|
||||
for source in [
|
||||
|
||||
Reference in New Issue
Block a user