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

Some API requests with a "&" in area name fail #1528

Open
2 tasks done
MartinBelthle opened this issue May 22, 2023 · 2 comments
Open
2 tasks done

Some API requests with a "&" in area name fail #1528

MartinBelthle opened this issue May 22, 2023 · 2 comments
Labels
api REST API bug Something isn't working front-end

Comments

@MartinBelthle
Copy link
Contributor

MartinBelthle commented May 22, 2023

Description

When creating an area with "&" in its name, it is not possible to edit its load matrix with the front.

Steps to Reproduce

  1. Create an area named "a&b"
  2. Try to modify the load matrix associated to the area
  3. See that it fails

Expected Behavior

It should be possible to edit the load matrix with the front.

Possible Solution

The problem is that the API used it this : /v1/studies/study_id/matrix?path=input/load/series/load_a&b
The & creates a new parameter in the API request which is b and path is only input/load/series/load_a, therefore the request fails.

The solution I see is to escape this character in the API path request.

Environment

  • Production
  • Staging
@MartinBelthle MartinBelthle added bug Something isn't working awaiting response(s) api REST API and removed awaiting response(s) labels May 22, 2023
@MartinBelthle MartinBelthle changed the title Some API requests with a "&" in area name fails Some API requests with a "&" in area name fail May 22, 2023
@MartinBelthle
Copy link
Contributor Author

@skamril / @hdinia i think this is a front-end issue but i'm not sure, what do you think ?

@laurent-laporte-pro
Copy link
Contributor

When a Area ID (or any other parameter) is used in a URL, the ID should be URL-encoded. I think this an issue in the front office code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api REST API bug Something isn't working front-end
Projects
None yet
Development

No branches or pull requests

4 participants