Skip to content

Commit a6b425e

Browse files
Merge pull request #59 from geo-engine/openapi-enum-names
fix: openapi enum variant names
2 parents 0d339f0 + e48da0b commit a6b425e

621 files changed

Lines changed: 24347 additions & 3818 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.generation/input/openapi.json

Lines changed: 972 additions & 83 deletions
Large diffs are not rendered by default.

.generation/post-process/typescript.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def file_modifications() -> Generator[tuple[Path, FileModifier], None, None]:
2020
yield Path("models/TaskStatusWithId.ts"), task_status_with_id_ts
2121
yield Path("models/VecUpdate.ts"), vec_update_ts
2222
yield Path("models/TypedOperator.ts"), typed_operator_ts
23+
yield Path("models/HistogramBounds.ts"), histogram_bounds_ts
2324
yield Path("runtime.ts"), runtime_ts
2425

2526

@@ -173,5 +174,13 @@ def vec_update_ts(file_contents: list[str]) -> Generator[str, None, None]:
173174
yield line
174175

175176

177+
def histogram_bounds_ts(file_contents: list[str]) -> Generator[str, None, None]:
178+
"""Fix TS2352 in HistogramBoundsToJSONTyped for Data | object oneOf."""
179+
for line in file_contents:
180+
yield line.replace(
181+
"DataToJSON(value as Data)", "DataToJSON(value as unknown as Data)"
182+
)
183+
184+
176185
if __name__ == "__main__":
177186
main()

justfile

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@ _default:
99
_clear:
1010
@-clear
1111

12-
1312
# Build all API clients by executing the build steps for each language.
1413
[group('build')]
15-
build: _clear \
16-
_build-python-preprocess _build-rust-preprocess _build-typescript-preprocess \
17-
_build_call \
18-
_build-python-postprocess _build-rust-postprocess _build-typescript-postprocess
14+
build: _clear _build-python-preprocess _build-rust-preprocess _build-typescript-preprocess _build_call _build-python-postprocess _build-rust-postprocess _build-typescript-postprocess
1915

2016
_build_call generator="":
2117
{{ OPENAPI_GENERATOR_CLI }} generate {{ if generator == "" { "" } else { "--generator-key " + generator } }}
@@ -43,12 +39,13 @@ _build-python-postprocess:
4339

4440
# Build the API clients for TypeScript by generating code with the OpenAPI Generator and applying post-processing steps. Also install npm dependencies and set up .gitignore.
4541
[group('build')]
46-
build-typescript: _clear (_build_call "typescript") _build-typescript-postprocess
42+
build-typescript: _clear _build-typescript-preprocess (_build_call "typescript") _build-typescript-postprocess
4743

4844
# Remove some directories because they are not be overwritten by the generator.
4945
_build-typescript-preprocess:
5046
rm -rf \
5147
typescript/src \
48+
typescript/docs \
5249
typescript/dist \
5350
typescript/node_modules \
5451
typescript/diffs
@@ -69,6 +66,9 @@ build-rust: _clear _build-rust-preprocess (_build_call "rust") _build-rust-postp
6966

7067
_build-rust-preprocess:
7168
rm -rf \
69+
rust/src/apis \
70+
rust/src/models \
71+
rust/docs \
7272
rust/diffs
7373

7474
_build-rust-postprocess:
@@ -85,7 +85,8 @@ lint-openapi-spec: _clear
8585
--recommend
8686

8787
# Generate the OpenAPI Generator configuration files from the config.ini.
88-
[group('config'), script("python3")]
88+
[group('config')]
89+
[script("python3")]
8990
update-generator-configs:
9091
import configparser
9192
import json
@@ -122,8 +123,8 @@ update-generator-configs:
122123
print("Generated OpenAPI Generator configuration for TypeScript, Python, and Rust.")
123124

124125
# Update the backend commit in the config.ini and increment the version.
125-
[group('config')]
126126
[arg("backendCommit", long="backendCommit", help="The commit hash of the backend for which to fetch the OpenAPI specification.")]
127+
[group('config')]
127128
update-config backendCommit: _clear (_update-config backendCommit) update-generator-configs (fetch-openapi-spec backendCommit) lint-openapi-spec
128129

129130
[script("python3")]
@@ -153,8 +154,8 @@ _update-config backendCommit:
153154
print(f"Updated {INI_FILE} with backendCommit={config['input']['backendCommit']} and version={config['general']['version']}.")
154155

155156
# Fetch the OpenAPI specification for the given backend commit from the Geo Engine repository and save it to the input directory.
156-
[group('config')]
157157
[arg("backendCommit", long="backendCommit", help="The commit hash of the backend for which to fetch the OpenAPI specification.")]
158+
[group('config')]
158159
fetch-openapi-spec backendCommit:
159160
@echo "Fetching OpenAPI specification for backend commit {{ backendCommit }}…"
160161
curl \
@@ -181,11 +182,11 @@ test: _clear test-python test-rust test-typescript
181182
test-python: _clear
182183
#!/usr/bin/env bash
183184
python3 -m venv .venv && source .venv/bin/activate || source .venv/bin/activate
184-
185+
185186
python -m pip install --upgrade pip
186187
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
187188
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
188-
189+
189190
pytest
190191
191192
[group('test')]
@@ -198,4 +199,4 @@ test-rust: _clear
198199
[working-directory("typescript")]
199200
test-typescript: _clear
200201
npm install
201-
npm run build
202+
npm run build

0 commit comments

Comments
 (0)