-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve details of POST journeys on 422 #2728
Improve details of POST journeys on 422 #2728
Conversation
WalkthroughThe pull request updates the OpenAPI specification for the "Registre de preuve de covoiturage" API from version 3.0.3 to 3.1. Key modifications include enhanced response descriptions and schemas, particularly for the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
api/specs/api-v3.1.yaml (1)
142-168
: Consider marking required fields in the schema.The schema is well-structured but could benefit from explicitly marking required fields. Consider adding the
required
array at the root level to specify which fields must be present in the response.schema: type: object properties: id: type: integer example: 1 jsonrpc: type: string example: '2.0' error: type: object properties: data: type: object properties: terms_violation_labels: $ref: '#/components/schemas/terms_violation_label' required: - terms_violation_labels code: type: integer enum: - -32422 message: type: string enum: - Unprocessable Request + required: + - id + - jsonrpc + - error
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
api/specs/api-v3.1.yaml
(1 hunks)
🔇 Additional comments (1)
api/specs/api-v3.1.yaml (1)
138-139
: LGTM! Clear and accurate description for 422 response.
The description effectively communicates:
- The reason for the 422 error (payload validation failure)
- The outcome (journey not recorded)
5170b39
to
6883976
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
api/specs/api-v3.1.yaml (1)
138-169
: LGTM! Consider adding examples to improve documentation.The changes effectively document the 422 response schema with clear descriptions and proper structure. The schema correctly includes all necessary fields and uses enums to restrict possible values.
To further improve the documentation, consider adding examples:
content: application/json: schema: type: object + example: + id: 1 + jsonrpc: "2.0" + error: + data: + terms_violation_labels: + - expired + - distance_too_short + code: -32422 + message: "Unprocessable Request" properties:
Description
Proposition d'amélioration de la spec OpenAPI du POST Journeys afin de :
terms_violation_labels
en cas de 422Checklist
[ ] j'ai mis à jour la documentation technique=> on n'y a pas accès @jonathanfallon mais possiblement ce n'est plus d'actualité car c'est dans le repo[ ] ajout ou mise à jour des tests unitaires[ ] ajout ou mise à jour des tests d'intégrationMerge
Je squash la PR et vérifie que le message de commit utilise la convention d'Angular :
Voir la convention de message de commit...
Types de commit
Le scope (optionnel) précise le module ou le composant impacté par le commit.
Summary by CodeRabbit
New Features
/journeys
endpoint, including detailed response descriptions for422
status codes.Documentation