update openapi - #25
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the OpenAPI specification to include security documentation for authentication via session cookies, and refactors React components to use Fragments instead of unnecessary div wrappers.
- Adds SessionCookie security scheme to all protected API endpoints in the OpenAPI specification
- Removes the deprecated sample endpoint (/api/session) and its related code
- Refactors React components to replace unnecessary
<div>wrappers with React Fragments (<>) - Simplifies heading hierarchy in the GroupDetail component
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| products/frontend/openapi.json | Added global and per-endpoint security configuration for SessionCookie authentication; removed sample endpoint definition |
| products/frontend/src/routes/Root/index.tsx | Replaced div wrapper with React Fragment |
| products/frontend/src/routes/Invite/index.tsx | Replaced div wrappers with React Fragments |
| products/frontend/src/routes/GroupDetail/index.tsx | Replaced div wrappers with React Fragments; simplified heading hierarchy from h1+h2 to single h1 |
| products/frontend/src/routes/GenerateGroup/index.tsx | Replaced div wrappers with React Fragments |
| products/backend/src/presentation/routes/userProfile.ts | Added security field to getUserProfile and updateUserProfile endpoints |
| products/backend/src/presentation/routes/sample.ts | Deleted deprecated sample endpoint file |
| products/backend/src/presentation/routes/info.ts | Added security field to info endpoints |
| products/backend/src/presentation/routes/group.ts | Added security field to group endpoints |
| products/backend/src/presentation/factory/hono.ts | Registered SessionCookie security scheme component |
| products/backend/src/presentation/api.protected.ts | Removed sample route registration |
| products/backend/src/index.ts | Updated OpenAPI info metadata to match project details |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| title: 'Pay Crew2 API', | ||
| version: '0.0.1', | ||
| description: 'API documentation for Pay Crew2 backend', | ||
| }, |
There was a problem hiding this comment.
The OpenAPI specification includes a global security configuration (lines 3-7 in openapi.json), but the backend code that generates the OpenAPI spec doesn't include this global security field in the app.doc configuration. To ensure consistency between the generated spec and the JSON file, consider adding a global security field to the app.doc call in index.ts. This would automatically apply the SessionCookie security requirement to all endpoints unless explicitly overridden.
| }, | |
| }, | |
| security: [ | |
| { | |
| SessionCookie: [], | |
| }, | |
| ], |
No description provided.