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

Add REST API root resource #658

Merged
merged 4 commits into from
Jan 16, 2023
Merged

Conversation

UnniKohonen
Copy link
Contributor

@UnniKohonen UnniKohonen commented Dec 23, 2022

This PR adds a resource to the root of the REST API (i.e. http://<annif_host>/v1/) that gives basic information on the API. The information given is a title for the API and the version of Annif being used. The response is a json object with the format:

{
    "title": "Annif REST API",
    "version": "0.60.0"
}

Implements #655

@codecov
Copy link

codecov bot commented Dec 23, 2022

Codecov Report

Base: 99.55% // Head: 99.55% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (a4e5be8) compared to base (45be34d).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #658   +/-   ##
=======================================
  Coverage   99.55%   99.55%           
=======================================
  Files          87       87           
  Lines        6006     6017   +11     
=======================================
+ Hits         5979     5990   +11     
  Misses         27       27           
Impacted Files Coverage Δ
annif/rest.py 96.55% <100.00%> (+0.18%) ⬆️
tests/test_rest.py 100.00% <100.00%> (ø)
tests/test_config.py 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@osma
Copy link
Member

osma commented Jan 9, 2023

Looks good so far. A couple of suggestions:

  • black formatting should be applied to the dict returned by show_info (see details)
  • there should be a unit test in tests/test_rest.py checking that the show_info method returns what is expected

Copy link
Member

@osma osma left a comment

Choose a reason for hiding this comment

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

Excellent work!

@UnniKohonen UnniKohonen added this to the 0.60 milestone Jan 16, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@UnniKohonen UnniKohonen marked this pull request as ready for review January 16, 2023 10:58
@UnniKohonen UnniKohonen merged commit db3c468 into master Jan 16, 2023
@UnniKohonen UnniKohonen deleted the issue655-rest-api-root-resource branch January 16, 2023 11:00
@juhoinkinen juhoinkinen linked an issue Jan 20, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REST API root resource with version information
2 participants