Skip to content

Commit 7f3a5f3

Browse files
Use a simplified namespace value for the OpenAPI tags (#2889) (#2945)
(cherry picked from commit bf8b9d8) Co-authored-by: Lisa Cawley <[email protected]>
1 parent b177191 commit 7f3a5f3

File tree

4 files changed

+938
-938
lines changed

4 files changed

+938
-938
lines changed

compiler-rs/clients_schema_to_openapi/src/paths.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ pub fn add_endpoint(
4747
}
4848

4949
// Namespace
50-
// let namespace = match endpoint.name.split_once('.') {
51-
// Some((ns, _)) => ns,
52-
// None => "core",
53-
//};
50+
let namespace = match endpoint.name.split_once('.') {
51+
Some((ns, _)) => ns,
52+
None => &endpoint.name,
53+
};
5454

5555
// Will we produce multiple paths? If true, we will register components for reuse across paths
5656
let is_multipath = endpoint.urls.len() > 1 || endpoint.urls.iter().any(|u| u.methods.len() > 1);
@@ -196,7 +196,7 @@ pub fn add_endpoint(
196196

197197
// Create the operation, it will be repeated if we have several methods
198198
let operation = openapiv3::Operation {
199-
tags: vec![endpoint.name.clone()],
199+
tags: vec![namespace.to_string()],
200200
summary: sum_desc.summary,
201201
description: sum_desc.description,
202202
external_docs: tac.convert_external_docs(endpoint),
Binary file not shown.

0 commit comments

Comments
 (0)