-
Notifications
You must be signed in to change notification settings - Fork 333
Make schema-profunctor schema names derived and avoid name clashes between scopes. #5151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
fisx
wants to merge
18
commits into
develop
Choose a base branch
from
fisx/openapi-swagger-hacking
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
061a027
Script for generating kotlin and typescript code from swagger.json.
fisx a9eecc8
openapi3 aka swagger: Make schema names unique(r).
fisx 18df1ac
Add missing Typeable constraints.
fisx 289edfd
Remove now unused name arguemnts from object, enum.
fisx 9b6c2fb
Keep named variants of object, enum, ... around for corner cases.
fisx 1f6e998
Remove now unused name arguments from object, enum (cont.).
fisx f0210f7
Versioned schemas.
fisx a9f12d3
Fix compiler errors.
fisx 9fd11c8
Fix type constraints.
fisx 35edfdb
Changelog.
fisx 9b45a35
Cleanup remaining TODOs.
fisx 1dc9b36
Make imports more consistent
fisx 6ed96a9
Merge remote-tracking branch 'refs/remotes/origin/fisx/openapi-swagge…
fisx 1327a1c
Fix compiler warning.
fisx aa9d606
Fix: mkSchemaName.
fisx 0e5ac8c
Drop dangling TODO.
fisx 0819cc2
[stash]
fisx 67b7773
generate-clients.sh: feed errors to stderr, not stdout.
fisx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Make schema-profunctor schema names derived and avoid name clashes between scopes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| # Simple OpenAPI client generator using openapi-generator | ||
| # Usage: ./generate-clients.sh <swagger-url> | ||
|
|
||
| SWAGGER_URL="${1:-https://staging-nginz-https.zinfra.io/v16/api/swagger.json}" | ||
| OUTPUT_DIR="$(pwd)/generated" | ||
|
|
||
| echo "==> Generating clients from: $SWAGGER_URL" | ||
| echo "==> Output directory: $OUTPUT_DIR" | ||
|
|
||
| # Clean up previous runs | ||
| rm -rf "$OUTPUT_DIR" | ||
| mkdir -p "$OUTPUT_DIR" | ||
|
|
||
| # Download the spec | ||
| echo "==> Downloading OpenAPI spec..." | ||
| curl -s "$SWAGGER_URL" > "$OUTPUT_DIR/swagger.json" | ||
|
|
||
| # Check if docker is available | ||
| if ! command -v docker &> /dev/null; then | ||
| echo "Error: docker is not installed. Please install docker to use openapi-generator." >&2 | ||
| echo "Alternative: install openapi-generator-cli via npm: npm install -g @openapitools/openapi-generator-cli" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Generate TypeScript client | ||
| echo "" | ||
| echo "==> Generating TypeScript client..." | ||
| docker run --rm \ | ||
| -v "$OUTPUT_DIR:/local" \ | ||
| openapitools/openapi-generator-cli:latest generate \ | ||
| -i /local/swagger.json \ | ||
| -g typescript-axios \ | ||
| -o /local/typescript \ | ||
| --additional-properties=supportsES6=true,npmName=wire-api-client,npmVersion=1.0.0 | ||
|
|
||
| # Generate Kotlin client | ||
| echo "" | ||
| echo "==> Generating Kotlin client..." | ||
| docker run --rm \ | ||
| -v "$OUTPUT_DIR:/local" \ | ||
| openapitools/openapi-generator-cli:latest generate \ | ||
| -i /local/swagger.json \ | ||
| -g kotlin \ | ||
| -o /local/kotlin \ | ||
| --additional-properties=packageName=com.wire.api.client,serializationLibrary=gson | ||
|
|
||
| echo "" | ||
| echo "==> Done! Generated clients:" | ||
| echo " TypeScript: $OUTPUT_DIR/typescript" | ||
| echo " Kotlin: $OUTPUT_DIR/kotlin" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.