Skip to content

feat: add SDK codegen configuration and generate TypeScript/Python SDKs#492

Open
sudo-robi wants to merge 2 commits intorinafcode:mainfrom
sudo-robi:feature/sdk-codegen
Open

feat: add SDK codegen configuration and generate TypeScript/Python SDKs#492
sudo-robi wants to merge 2 commits intorinafcode:mainfrom
sudo-robi:feature/sdk-codegen

Conversation

@sudo-robi
Copy link
Copy Markdown
Contributor

closes #439

- Add OpenAPI spec generation script
- Add npm scripts for SDK generation (sdk:generate, sdk:generate:ts, sdk:generate:python)
- Generate TypeScript SDK using typescript-axios
- Generate Python SDK using python
- Add openapitools.json configuration
Copilot AI review requested due to automatic review settings April 29, 2026 06:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an OpenAPI-driven SDK generation workflow to the repo and commits the generated TypeScript (axios) + Python client SDKs to address the “no client SDKs” gap (closes #439).

Changes:

  • Added an OpenAPI spec generator script + OpenAPI Generator CLI configuration, and wired them into package.json scripts.
  • Committed generated TypeScript SDK (typescript-axios) sources + docs.
  • Committed generated Python SDK package (client code, docs, packaging files, and test stubs).

Reviewed changes

Copilot reviewed 66 out of 69 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
scripts/generate-openapi-spec.ts Generates openapi-spec.json used as input for SDK generation
openapi-spec.json Generated OpenAPI document checked into the repo
openapitools.json Pins/configures OpenAPI Generator CLI version for reproducible generation
package.json Adds SDK generation scripts and OpenAPI Generator CLI dev dependency
sdk/typescript/index.ts TS SDK barrel exports
sdk/typescript/api.ts Generated TS API client + request models
sdk/typescript/base.ts Generated TS base API helpers/constants
sdk/typescript/common.ts Generated TS request/auth/query serialization utilities
sdk/typescript/configuration.ts Generated TS client configuration (auth/basePath/etc)
sdk/typescript/docs/AuthApi.md Generated TS API docs (Auth)
sdk/typescript/docs/AuthLoginPostRequest.md Generated TS model docs
sdk/typescript/docs/CoursesApi.md Generated TS API docs (Courses)
sdk/typescript/docs/CoursesPostRequest.md Generated TS model docs
sdk/typescript/docs/HealthApi.md Generated TS API docs (Health)
sdk/typescript/docs/UsersApi.md Generated TS API docs (Users)
sdk/typescript/docs/UsersPostRequest.md Generated TS model docs
sdk/typescript/git_push.sh OpenAPI Generator template script (git publish helper)
sdk/typescript/.gitignore Generated TS SDK ignore rules
sdk/typescript/.npmignore Generated TS SDK npm publishing behavior
sdk/typescript/.openapi-generator-ignore OpenAPI Generator ignore configuration for TS output
sdk/typescript/.openapi-generator/VERSION Generator version used for TS output
sdk/typescript/.openapi-generator/FILES Manifest of generated TS files
sdk/python/README.md Generated Python SDK README
sdk/python/pyproject.toml Generated Python packaging metadata/tooling config
sdk/python/setup.py Generated Python setuptools packaging
sdk/python/setup.cfg Generated Python lint config
sdk/python/requirements.txt Generated Python runtime dependencies
sdk/python/test-requirements.txt Generated Python test/tooling dependencies
sdk/python/tox.ini Generated tox config for running Python tests
sdk/python/.gitignore Generated Python SDK ignore rules
sdk/python/.travis.yml Generated CI template (Travis) for the Python SDK
sdk/python/.gitlab-ci.yml Generated CI template (GitLab CI) for the Python SDK
sdk/python/.github/workflows/python.yml Generated CI template (GitHub Actions) for the Python SDK
sdk/python/git_push.sh OpenAPI Generator template script (git publish helper)
sdk/python/openapi_client/init.py Generated Python SDK package exports
sdk/python/openapi_client/api/init.py Generated Python API package exports
sdk/python/openapi_client/api/auth_api.py Generated Python Auth API client
sdk/python/openapi_client/api/courses_api.py Generated Python Courses API client
sdk/python/openapi_client/api/health_api.py Generated Python Health API client
sdk/python/openapi_client/api/users_api.py Generated Python Users API client
sdk/python/openapi_client/api_client.py Generated Python HTTP client/serialization core
sdk/python/openapi_client/api_response.py Generated Python ApiResponse model
sdk/python/openapi_client/configuration.py Generated Python client configuration/auth/host handling
sdk/python/openapi_client/exceptions.py Generated Python exception types
sdk/python/openapi_client/rest.py Generated Python REST transport wrapper (urllib3)
sdk/python/openapi_client/py.typed Declares typing support for the Python package
sdk/python/openapi_client/models/init.py Generated Python model exports
sdk/python/openapi_client/models/auth_login_post_request.py Generated Python Pydantic request model
sdk/python/openapi_client/models/courses_post_request.py Generated Python Pydantic request model
sdk/python/openapi_client/models/users_post_request.py Generated Python Pydantic request model
sdk/python/docs/AuthApi.md Generated Python API docs (Auth)
sdk/python/docs/AuthLoginPostRequest.md Generated Python model docs
sdk/python/docs/CoursesApi.md Generated Python API docs (Courses)
sdk/python/docs/CoursesPostRequest.md Generated Python model docs
sdk/python/docs/HealthApi.md Generated Python API docs (Health)
sdk/python/docs/UsersApi.md Generated Python API docs (Users)
sdk/python/docs/UsersPostRequest.md Generated Python model docs
sdk/python/test/init.py Generated Python test package marker
sdk/python/test/test_auth_api.py Generated Python test stubs (Auth)
sdk/python/test/test_auth_login_post_request.py Generated Python test stubs (model)
sdk/python/test/test_courses_api.py Generated Python test stubs (Courses)
sdk/python/test/test_courses_post_request.py Generated Python test stubs (model)
sdk/python/test/test_health_api.py Generated Python test stubs (Health)
sdk/python/test/test_users_api.py Generated Python test stubs (Users)
sdk/python/test/test_users_post_request.py Generated Python test stubs (model)
sdk/python/.openapi-generator-ignore OpenAPI Generator ignore configuration for Python output
sdk/python/.openapi-generator/VERSION Generator version used for Python output
sdk/python/.openapi-generator/FILES Manifest of generated Python files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread openapi-spec.json
"title": "TeachLink API",
"description": "TeachLink Backend API Documentation",
"version": "1.0"
},
Comment on lines +63 to +92
patch: {
tags: ['users'],
summary: 'Update user',
parameters: [
{
name: 'id',
in: 'path',
required: true,
schema: { type: 'string' },
},
],
responses: {
200: { description: 'User updated' },
},
},
delete: {
tags: ['users'],
summary: 'Delete user (Admin only)',
parameters: [
{
name: 'id',
in: 'path',
required: true,
schema: { type: 'string' },
},
],
responses: {
200: { description: 'User deleted' },
},
},
Comment on lines +224 to +241
'/health': {
get: {
tags: ['health'],
summary: 'Health check',
responses: {
200: { description: 'Service is healthy' },
},
},
},
'/health/liveness': {
get: {
tags: ['health'],
summary: 'Liveness probe',
responses: {
200: { description: 'Service is alive' },
},
},
},
Comment thread openapi-spec.json
Comment on lines +73 to +137
"/users/{id}": {
"get": {
"tags": [
"users"
],
"summary": "Get user by ID",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "User found"
}
}
},
"patch": {
"tags": [
"users"
],
"summary": "Update user",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "User updated"
}
}
},
"delete": {
"tags": [
"users"
],
"summary": "Delete user (Admin only)",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "User deleted"
}
}
}
},
# create an instance of CoursesPostRequest from a JSON string
courses_post_request_instance = CoursesPostRequest.from_json(json)
# print the JSON string representation of the object
print(CoursesPostRequest.to_json())
Comment thread sdk/python/.travis.yml
Comment on lines +1 to +17
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
# uncomment the following if needed
#- "3.14-dev" # 3.14 development branch
#- "nightly" # nightly build
# command to install dependencies
install:
- "pip install -r requirements.txt"
- "pip install -r test-requirements.txt"
# command to run tests
script: pytest --cov=openapi_client
Comment thread sdk/python/.gitlab-ci.yml
Comment on lines +4 to +31
# ref: https://docs.gitlab.com/ee/ci/README.html
# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml

stages:
- test

.pytest:
stage: test
script:
- pip install -r requirements.txt
- pip install -r test-requirements.txt
- pytest --cov=openapi_client

pytest-3.10:
extends: .pytest
image: python:3.10-alpine
pytest-3.11:
extends: .pytest
image: python:3.11-alpine
pytest-3.12:
extends: .pytest
image: python:3.12-alpine
pytest-3.13:
extends: .pytest
image: python:3.13-alpine
pytest-3.14:
extends: .pytest
image: python:3.14-alpine
Comment on lines +47 to +62
'/users/{id}': {
get: {
tags: ['users'],
summary: 'Get user by ID',
parameters: [
{
name: 'id',
in: 'path',
required: true,
schema: { type: 'string' },
},
],
responses: {
200: { description: 'User found' },
},
},
# create an instance of UsersPostRequest from a JSON string
users_post_request_instance = UsersPostRequest.from_json(json)
# print the JSON string representation of the object
print(UsersPostRequest.to_json())
Comment on lines +271 to +299
```python
import openapi_client
from openapi_client.models.courses_post_request import CoursesPostRequest
from openapi_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration(
host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): bearerAuth
configuration = openapi_client.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = openapi_client.CoursesApi(api_client)
courses_post_request = openapi_client.CoursesPostRequest() # CoursesPostRequest |

try:
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 29, 2026

@sudo-robi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER
Copy link
Copy Markdown
Contributor

Kindly resolve conflict

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SDK Generation

3 participants