oas3-gen 0.5.0

A rust type generator for OpenAPI v3.1.x specification.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// Convert a string into doc comment lines with `///` prefix
pub(crate) fn doc_comment_lines(input: &str) -> Vec<String> {
  let normalized = input.replace("\\n", "\n");
  normalized
    .lines()
    .map(|line| {
      if line.is_empty() {
        "/// ".to_string()
      } else {
        format!("/// {}", line)
      }
    })
    .collect()
}