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

Duplicate definition of the /simulations route #1952

Open
mikesmit opened this issue Nov 6, 2024 · 5 comments
Open

Duplicate definition of the /simulations route #1952

mikesmit opened this issue Nov 6, 2024 · 5 comments
Assignees

Comments

@mikesmit
Copy link
Collaborator

mikesmit commented Nov 6, 2024

in policyengine_api/app.py there are two identical route definitions:

app.route("/simulations", methods=["GET"])(get_simulations)

app.route("/simulations", methods=["GET"])(get_simulations)
@mikesmit
Copy link
Collaborator Author

mikesmit commented Nov 6, 2024

I am picking this up as an easy first contribution. Reaching out to request contributor access as per the README

@mikesmit
Copy link
Collaborator Author

mikesmit commented Nov 6, 2024

Confirmed that removing one of the two lines does not stop the service from responding to curl http://127.0.0.1:5000/simulations with a valid JSON response.

Removing both results in a 404 error.

@mikesmit
Copy link
Collaborator Author

mikesmit commented Nov 7, 2024

Code is ready, but make debug-test is failing with

dataset.py:308: in download
    raise ValueError(
E   ValueError: Invalid response code 404 for url https://api.github.com/repos/PolicyEngine/ukda/releases/tags/1.9.0.

Reached out on slack to see what the deal with that is (unrelated to my change I'm 99% sure)

@mikesmit
Copy link
Collaborator Author

mikesmit commented Nov 7, 2024

Confirmed the test error is unrelated to my change and submitted make debug-test fails with 404 error #1954 to track.

mikesmit pushed a commit that referenced this issue Nov 7, 2024
The flask app defines the same GET operation on /simulations twice. This
change simply removes one of them.
@mikesmit
Copy link
Collaborator Author

mikesmit commented Nov 7, 2024

put in pull request

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

No branches or pull requests

1 participant