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
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# project-name
# apollo-openapi

Do whatever you want with this template, typically used to create a new project.

## Variables

> globally replace the following variable(e.g., `git-repo-name`) with your project details using your editor's find-and-replace tool.

- git-repo-name: the Git repository name
![OpenAPI](https://img.shields.io/badge/spec-OpenAPI%203.1-blue)
[![npm](https://img.shields.io/npm/v/apollo-openapi?label=npm&color=cb3837&logo=npm)](https://www.npmjs.com/package/apollo-openapi)
[![PyPI version](https://img.shields.io/pypi/v/apollo-openapi.svg)](https://pypi.org/project/apollo-openapi)
13 changes: 13 additions & 0 deletions clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -e

JAVA_DIR="java"
PYTHON_DIR="python"
RUST_DIR="rust"
TS_DIR="typescript"

echo "🧹 Cleaning old generated SDKs..."
rm -rf "$JAVA_DIR"
rm -rf "$PYTHON_DIR"
rm -rf "$RUST_DIR"
rm -rf "$TS_DIR"
39 changes: 39 additions & 0 deletions generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
set -e

SPEC_FILE="apollo-openapi.yaml"
JAVA_DIR="java"
PYTHON_DIR="python"
RUST_DIR="rust"
TS_DIR="typescript"

echo "🧹 Cleaning old generated SDKs..."
rm -rf "$JAVA_DIR"
rm -rf "$PYTHON_DIR"
rm -rf "$RUST_DIR"
rm -rf "$TS_DIR"

echo "🚀 Generating Python SDK..."
openapi-generator generate \
-i "$SPEC_FILE" \
-g python \
-o "$PYTHON_DIR" \
--package-name apollo_openapi \
--additional-properties=projectName=apollo-openapi,packageVersion=0.0.1

echo "🚀 Generating TypeScript SDK..."
openapi-generator generate \
-i "$SPEC_FILE" \
-g typescript-fetch \
-o "$TS_DIR" \
--additional-properties=npmName=apollo-openapi,npmVersion=0.0.1,typescriptThreePlus=true

echo "🚀 Generating Rust SDK..."
openapi-generator generate \
-i "$SPEC_FILE" \
-g rust \
-o "$RUST_DIR" \
--global-property models,supportingFiles \
--additional-properties=packageName=apollo-openapi,packageVersion=0.0.1

echo "✅ SDK generation complete."