Skip to content

fix(api): updation - #16

Merged
athulrajtflycatchtech merged 1 commit into
devfrom
feat/contact
Sep 1, 2026
Merged

fix(api): updation#16
athulrajtflycatchtech merged 1 commit into
devfrom
feat/contact

Conversation

@athulrajtflycatchtech

Copy link
Copy Markdown

Changes

  • update OpenAPI URL path in FastAPI initialization for correct documentation access

Reviewer

@bprahul017

@athulrajtflycatchtech
athulrajtflycatchtech merged commit 21cfb46 into dev Sep 1, 2026
2 of 4 checks passed
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix OpenAPI schema URL under API prefix

🐞 Bug fix ⚙️ Configuration changes 🕐 Less than 5 minutes

Grey Divider

AI Description

• Serve the OpenAPI schema beneath the /api path prefix.
• Ensure Swagger UI loads the schema from the correct application URL.
High-Level Assessment

Directly changing FastAPI's openapi_url is the optimal approach because the application owns both documentation endpoints. Proxy rewrites or route aliases would add unnecessary deployment coupling for a one-path correction.

Files changed (1) +1 / -1

Bug fix (1) +1 / -1
main.pyMove the OpenAPI schema endpoint beneath '/api' +1/-1

Move the OpenAPI schema endpoint beneath '/api'

• Changes FastAPI's OpenAPI schema URL from '/openapi.json' to '/api/openapi.json', aligning it with the API-prefixed documentation route.

apps/Backend/src/flycatch_api/main.py

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. OpenAPI contract tests use old path 🐞 Bug ≡ Correctness
Description
Changing openapi_url removes /openapi.json, but both backend contract tests still request that
URL and will receive 404 responses, causing the test suite to fail. The repository specifications
also require the served OpenAPI document at /openapi.json, so this change violates the existing
contract unless all consumers and tests are migrated together.
Code

apps/Backend/src/flycatch_api/main.py[50]

+app = FastAPI(title="Flycatch API", version="2.0.0", docs_url="/api/docs", openapi_url="/api/openapi.json")
Evidence
The changed FastAPI configuration sets the OpenAPI route to /api/openapi.json. The backend
contract tests still call /openapi.json in both OpenAPI assertions, and the repository contract
documentation explicitly states that the served document is /openapi.json, proving the change
breaks an existing repository contract.

apps/Backend/tests/contract/test_openapi_parity.py[83-95]
specs/001-website-foundation/contracts/README.md[1-8]
specs/002-auth-rbac/contracts/README.md[1-10]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The FastAPI OpenAPI endpoint was changed from `/openapi.json` to `/api/openapi.json`, while the repository's contract tests and specifications still require `/openapi.json`. This makes the existing tests fail with 404 responses and breaks consumers of the established endpoint.

## Issue Context
Either preserve `/openapi.json` as the canonical endpoint, or deliberately migrate every test, specification, generated-client workflow, and runtime consumer to `/api/openapi.json`. If compatibility is required, expose both paths or add a redirect.

## Fix Focus Areas
- apps/Backend/src/flycatch_api/main.py[50-50]
- apps/Backend/tests/contract/test_openapi_parity.py[83-95]
- specs/001-website-foundation/contracts/README.md[1-8]
- specs/002-auth-rbac/contracts/README.md[1-10]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
Review mode: 🚀 Fast: This is a single localized configuration change to FastAPI's OpenAPI URL, with low risk and no security, schema, or broad behavioral impact.

Grey Divider

Tip of the day
💡 Did you know, you can describe a rule in plain language on the Rules page and Qodo drafts it for you

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

)

app = FastAPI(title="Flycatch API", version="2.0.0", docs_url="/api/docs", openapi_url="/openapi.json")
app = FastAPI(title="Flycatch API", version="2.0.0", docs_url="/api/docs", openapi_url="/api/openapi.json")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Openapi contract tests use old path 🐞 Bug ≡ Correctness

Changing openapi_url removes /openapi.json, but both backend contract tests still request that
URL and will receive 404 responses, causing the test suite to fail. The repository specifications
also require the served OpenAPI document at /openapi.json, so this change violates the existing
contract unless all consumers and tests are migrated together.
Agent Prompt
## Issue description
The FastAPI OpenAPI endpoint was changed from `/openapi.json` to `/api/openapi.json`, while the repository's contract tests and specifications still require `/openapi.json`. This makes the existing tests fail with 404 responses and breaks consumers of the established endpoint.

## Issue Context
Either preserve `/openapi.json` as the canonical endpoint, or deliberately migrate every test, specification, generated-client workflow, and runtime consumer to `/api/openapi.json`. If compatibility is required, expose both paths or add a redirect.

## Fix Focus Areas
- apps/Backend/src/flycatch_api/main.py[50-50]
- apps/Backend/tests/contract/test_openapi_parity.py[83-95]
- specs/001-website-foundation/contracts/README.md[1-8]
- specs/002-auth-rbac/contracts/README.md[1-10]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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.

1 participant