• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ValeriyMenshikov / restcodegen / 19739786445

27 Nov 2025 02:37PM UTC coverage: 83.311% (-3.5%) from 86.838%
19739786445

Pull #9

github

web-flow
Merge 494573424 into 04717a691
Pull Request #9: Release/2.0.1

340 of 414 new or added lines in 10 files covered. (82.13%)

7 existing lines in 2 files now uncovered.

614 of 737 relevant lines covered (83.31%)

2.5 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/restcodegen/cli/main.py
1
import click
×
2

3
from restcodegen.generator.parser import Parser
×
NEW
4
from restcodegen.generator.codegen import RESTClientGenerator
×
5
from restcodegen.generator.utils import format_file
×
6

7

8
@click.group()
9
def cli() -> None: ...
10

11

12
@click.command("generate")
×
13
@click.option(
×
14
    "--url",
15
    "-u",
16
    required=True,
17
    type=str,
18
    help="OpenAPI spec URL",
19
)
20
@click.option(
×
21
    "--service-name",
22
    "-s",
23
    required=True,
24
    type=str,
25
    help="service name",
26
)
27
@click.option(
×
28
    "--async",
29
    "-a",
30
    "async_mode",
31
    is_flag=True,
32
    help="Enable async client generation",
33
)
34
@click.option(
×
35
    "--api-tags",
36
    "-t",
37
    required=False,
38
    type=str,
39
    help="Api tags for generate clients only for selected tags (comma-separated)",
40
    default=None,
41
)
42
@click.option(
×
43
    "--templates-dir",
44
    "-td",
45
    required=False,
46
    type=click.Path(exists=True, dir_okay=True, file_okay=False),
47
    help="Path to custom API client template",
48
    default=None,
49
)
50
@click.option(
×
51
    "--output-dir",
52
    "-o",
53
    required=False,
54
    type=click.Path(file_okay=False),
55
    help="Output directory for generated clients (default: ./clients/http)",
56
    default=None,
57
)
58
def generate_command(
×
59
    url: str,
60
    service_name: str,
61
    async_mode: bool,
62
    api_tags: str | None,
63
    templates_dir: str | None,
64
    output_dir: str | None,
65
) -> None:
NEW
66
    parser = Parser.from_source(
×
67
        openapi_spec=url,
68
        package_name=service_name,
69
        selected_tags=api_tags.split(",") if api_tags else None,
70
    )
71
    gen = RESTClientGenerator(
×
72
        openapi_spec=parser,
73
        async_mode=async_mode,
74
        templates_dir=templates_dir,
75
        base_path=output_dir,
76
    )
77
    gen.generate()
×
78
    format_file(output_dir)
×
79

80

81
cli.add_command(generate_command)
×
82

83
if __name__ == "__main__":
×
84
    cli()
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc