fix(api): updation - #16
Conversation
…ct documentation access
PR Summary by QodoFix OpenAPI schema URL under API prefix
AI Description
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1. OpenAPI contract tests use old path
|
| ) | ||
|
|
||
| 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") |
There was a problem hiding this comment.
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
Changes
Reviewer
@bprahul017