Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ jobs:
- name: Normalize spec for the Java generator
run: |
python3 -c 'import yaml' 2>/dev/null || python3 -m pip install --quiet --break-system-packages pyyaml
python3 scripts/normalize-spec-for-java.py openapi.yaml "$RUNNER_TEMP/openapi-java.yaml"
python3 scripts/normalize-spec-for-java.py openapi.yaml "$RUNNER_TEMP/openapi-java.json"

- name: Generate SDK
run: |
openapi-generator-cli generate \
-i "$RUNNER_TEMP/openapi-java.yaml" \
-i "$RUNNER_TEMP/openapi-java.json" \
-g java \
-o . \
--skip-validate-spec \
Expand Down
5 changes: 4 additions & 1 deletion scripts/normalize-spec-for-java.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
still deserializes into the right runtime shape) instead of failing the build.
"""

import json
import sys

import yaml
Expand Down Expand Up @@ -59,8 +60,10 @@ def main():
collapsed = []
collapse_unexpressible_unions(spec, "$", collapsed)

# JSON, not YAML: swagger-parser's SnakeYAML rejects YAML over 3,145,728
# code points, and the spec outgrew that on 2026-09-09.
with open(destination, "w") as out:
yaml.safe_dump(spec, out, sort_keys=False, allow_unicode=True, width=10**9)
json.dump(spec, out, ensure_ascii=False, default=str)

for location in collapsed:
print(f"collapsed to free-form (unexpressible in Java): {location}")
Expand Down
Loading