2
2
use std:: {
3
3
env,
4
4
net:: { IpAddr , SocketAddr } ,
5
+ path:: PathBuf ,
5
6
} ;
6
7
7
8
use clap:: Args ;
@@ -41,7 +42,7 @@ const API_URL_PREFIX_DEFAULT: &str = "/api";
41
42
/// the URL to the `PostgreSQL` event database,
42
43
/// and the logging level.
43
44
#[ derive( Args , Clone ) ]
44
- pub ( crate ) struct Settings {
45
+ pub ( crate ) struct ServiceSettings {
45
46
/// Server binding address
46
47
#[ clap( long, default_value = ADDRESS_DEFAULT ) ]
47
48
pub ( crate ) address : SocketAddr ,
@@ -55,6 +56,13 @@ pub(crate) struct Settings {
55
56
pub ( crate ) log_level : LogLevel ,
56
57
}
57
58
59
+ /// Settings specifies `OpenAPI` docs generation.
60
+ #[ derive( Args , Clone ) ]
61
+ pub ( crate ) struct DocsSettings {
62
+ /// The output path to the generated docs file, if omitted prints to stdout.
63
+ pub ( crate ) output : Option < PathBuf > ,
64
+ }
65
+
58
66
/// An environment variable read as a string.
59
67
pub ( crate ) struct StringEnvVar ( String ) ;
60
68
@@ -256,10 +264,10 @@ mod tests {
256
264
// }
257
265
258
266
#[ test]
259
- fn generate_github_issue_url ( ) {
267
+ fn generate_github_issue_url_test ( ) {
260
268
let title = "Hello, World! How are you?" ;
261
269
assert_eq ! (
262
- super :: generate_github_issue_url( title) . unwrap( ) . as_str( ) ,
270
+ generate_github_issue_url( title) . unwrap( ) . as_str( ) ,
263
271
"https://github.com/input-output-hk/catalyst-core/issues/new?template=bug_report.md&title=Hello%2C+World%21+How+are+you%3F"
264
272
) ;
265
273
}
0 commit comments