Skip to content
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

feat: Add response models (PUT/POST/DELETE endpoints untouched) #238

Merged
merged 2 commits into from
Mar 12, 2025

Conversation

suchithh
Copy link
Contributor

@suchithh suchithh commented Mar 4, 2025

What

This PR adds proper response models for all endpoints to ensure the FastAPI documentation accurately represents the actual response structure. Follow-up to #231.

Changes

  • Added HelloResponse model for root endpoint
  • Added TokenResponse model for auth endpoints
  • Added PingResponse model for /ping endpoint
  • Added ValueCount model for /values endpoint
  • Minor typo in an error response

These changes improve the documentation accuracy in the OpenAPI spec and potentially type safety for the API.

Fixes bug(s)

Fixes #118

@suchithh suchithh requested a review from a team as a code owner March 4, 2025 23:21
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.69%. Comparing base (b9cda65) to head (298cd5d).
Report is 67 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #238      +/-   ##
==========================================
- Coverage   95.06%   94.69%   -0.37%     
==========================================
  Files           5        5              
  Lines         324      377      +53     
==========================================
+ Hits          308      357      +49     
- Misses         16       20       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

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

Good idea, good you please add doc strings to all those models classes in another PR @suchithh

@alexgarel alexgarel merged commit 8e4d800 into openfoodfacts:main Mar 12, 2025
7 checks passed
@suchithh
Copy link
Contributor Author

@alexgarel On it!

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.

"Hello" API: the server response is different from the one expected
3 participants