Skip to content

docs(api): refresh OpenAPI spec and add API port proposals#316

Draft
Gonza10V wants to merge 3 commits intomasterfrom
codex/document-api-ports-using-swagger
Draft

docs(api): refresh OpenAPI spec and add API port proposals#316
Gonza10V wants to merge 3 commits intomasterfrom
codex/document-api-ports-using-swagger

Conversation

@Gonza10V
Copy link
Contributor

@Gonza10V Gonza10V commented Mar 3, 2026

Motivation

  • Bring the stored OpenAPI/Swagger spec into alignment with the currently exposed Flask routes and local dev server port to improve frontend/backend integration.
  • Provide a concise proposal for additional API "ports" (health/version, validation, async jobs, capabilities) to guide low-risk, incremental improvements to observability and long-running-workflow handling.

Description

  • Replaced and reworked backend/sbs_server/app/static/swagger.json with a consistent OpenAPI 3.0.3 document that describes the current endpoints and server URL (http://localhost:5003) and adds reusable request/response schemas such as UploadResourceRequest, UploadResponse, ErrorResponse, GoldenGateRequest, and PuduBuildRequest.
  • Documented active routes and their contracts including GET /api/status, POST /api/uploadResource, POST /api/uploadExperiment, POST /sbol_2_build_golden_gate, POST /api/build_pudu and POST /api/inspect_request, and marked existing placeholders that return 501 (assembly/transformation) with clear descriptions.
  • Added backend/API_PORT_PROPOSALS.md, a short design doc listing proposed endpoints to add (/api/version, /api/ready, /api/capabilities, /api/validate/*, and /api/jobs/*) with example payloads and a recommended rollout order.
  • This change is documentation/spec-focused and does not modify runtime route implementations or application logic.

Testing

  • Validated the OpenAPI JSON for syntax using python -m json.tool backend/sbs_server/app/static/swagger.json which succeeded without errors.
  • No runtime unit tests were required because only the API spec and proposal document were modified.

Codex Task

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9dfd9f3834

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

},
"servers": [
{
"url": "http://localhost:5003",

Choose a reason for hiding this comment

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

P2 Badge Use a non-localhost server URL in the OpenAPI spec

Hard-coding http://localhost:5003 as the only server makes Swagger "Try it out" fail for any non-local deployment context (e.g., container, staging VM, or another host on the network), because the browser will target the viewer's own localhost rather than the running API. Since this spec is served by the app itself (/api/docs -> /static/swagger.json), a relative server URL (or multiple environment entries) is needed to keep the documented endpoints usable outside local dev.

Useful? React with 👍 / 👎.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@codex solve this issue

Choose a reason for hiding this comment

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

Summary

Testing

  • python -m json.tool backend/sbs_server/app/static/swagger.json >/dev/null && echo OK
  • git diff -- backend/sbs_server/app/static/swagger.json

Also completed the requested follow-up workflow:

  • Committed changes: docs(api): use relative OpenAPI server URL
  • Created a follow-up PR via make_pr with title: docs(api): make OpenAPI server URL deployment-agnostic.

View task →

@github-actions
Copy link

github-actions bot commented Mar 3, 2026

Azure Static Web Apps: Your stage site is ready! Visit it here: https://witty-hill-08172a210-316.centralus.5.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Mar 3, 2026

Azure Static Web Apps: Your stage site is ready! Visit it here: https://witty-hill-08172a210-316.centralus.5.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Mar 3, 2026

Azure Static Web Apps: Your stage site is ready! Visit it here: https://witty-hill-08172a210-316.centralus.5.azurestaticapps.net

@Gonza10V Gonza10V marked this pull request as draft March 6, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant