Skip to content

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!

alexgarel pushed a commit that referenced this pull request Jun 23, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.2.0](v1.1.0...v1.2.0)
(2025-06-19)


### Features

* add Docker support for Folksonomy API
([#254](#254))
([f67dd13](f67dd13))
* Add message for existing property in product tag API
([#248](#248))
([5a6b6d1](5a6b6d1))
* Add pre-commit configuration for code quality checks
([#258](#258))
([db07627](db07627)),
closes
[#256](#256)
* Add response models (PUT/POST/DELETE endpoints untouched)
([#238](#238))
([8e4d800](8e4d800))
* adds allow_origins URLs for local development
([#284](#284))
([18ea2ee](18ea2ee))
* Adds logic to fetch specific keys for a product
([c3bc052](c3bc052))
* adds search query for /keys
([0798a27](0798a27))
* Adds type for /keys endpoint
([1ef42ff](1ef42ff))
* Improve setup doc
([962dd32](962dd32))
* Migrate dependency management to Poetry
([#247](#247))
([45d881a](45d881a))
* New route for values
([48cef31](48cef31))


### Bug Fixes

* add newline at end of .github/labeler.yml
([b86b0df](b86b0df))
* **ci:** skip workflow on forked repos
([#281](#281))
([d2757f3](d2757f3))
* PUT API response does not send ValidationError when expected
([#235](#235))
([7f3a589](7f3a589))
* pytest error with connection leak
([#270](#270))
([5c735f5](5c735f5))
* Returns a JSON response if desired result is not found
([#234](#234))
([e83fb5b](e83fb5b))
* updated labeler.yml file
([#279](#279))
([77e27d0](77e27d0))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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