File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,8 +36,10 @@ format: ## Format the code into unified format
3636schema : # # Generate OpenAPI schema file
3737 uv run scripts/generate_openapi_schema.py docs/openapi.json
3838
39- openapi-doc : docs/openapi.json # # Generate OpenAPI documentation
40- openapi-to-markdown --input_file docs/openapi.json --output_file docs/output.md
39+ openapi-doc : docs/openapi.json scripts/fix_openapi_doc.py # # Generate OpenAPI documentation
40+ openapi-to-markdown --input_file docs/openapi.json --output_file output.md
41+ python3 scripts/fix_openapi_doc.py < output.md > docs/output.md
42+ rm output.md
4143
4244# TODO uv migration
4345requirements.txt : pyproject.toml pdm.lock # # Generate requirements.txt file containing hashes for all non-devel packages
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+
3+ """Filter to fix the generated OpenAPI documentation."""
4+
5+ import fileinput
6+
7+ TABLE_ROW_CONTINUATION_LINE = " |"
8+
9+ lines = list (fileinput .input ())
10+
11+ lines_count = len (lines )
12+
13+ for i in range (lines_count ):
14+ current_line = lines [i ].rstrip ("\r \n " )
15+
16+ # limit check
17+ if i == lines_count - 1 :
18+ print (current_line )
19+ break
20+
21+ # the next line must exists -> read it
22+ next_line = lines [i + 1 ].rstrip ("\r \n " )
23+
24+ # skip the continuation line as it was used already
25+ # during previous line processing
26+ if current_line == TABLE_ROW_CONTINUATION_LINE :
27+ continue
28+
29+ # check if table row continuation line is present
30+ if next_line == TABLE_ROW_CONTINUATION_LINE :
31+ print (current_line + TABLE_ROW_CONTINUATION_LINE )
32+ else :
33+ print (current_line )
You can’t perform that action at this time.
0 commit comments