Repository navigation
Closed
Labels
bugSomething isn't working
Description
If we create a dashboardService as follows:
{
"name": "sample_superset",
"serviceType": "Superset",
"description": "Superset Service",
"dashboardUrl": "http://localhost:8088",
"username": "admin",
"password": "admin"
}
And the following Chart based on this service:
{
"chartType": "Line",
"chartUrl": "http://example.com",
"description": "string",
"displayName": "string",
"name": "random",
"service": {
"id": "f8d5d33e-bcaa-45cc-a13c-af9b083b9faf",
"type": "DashboardService" <- note the typo here, should be dashboardService
}
}
We get
> http POST http://localhost:8585/api/v1/charts < localtests/chart.json
HTTP/1.1 404 Not Found
Content-Length: 63
Content-Type: application/json
Date: Tue, 05 Oct 2021 19:49:26 GMT
{
"code": 404,
"message": "Entity type DashboardService not found"
}
The issue here is that if we fix the mayus typo and try to POST again, we get:
> http POST http://localhost:8585/api/v1/charts < localtests/chart.json
HTTP/1.1 409 Conflict
Content-Length: 46
Content-Type: application/json
Date: Tue, 05 Oct 2021 19:49:33 GMT
{
"code": 409,
"message": "Entity already exists"
}
So we need to PUT as the data is already created.
I checked this as well with the Dashboard <> Chart reference, and the issue persists. Note the error message saying that the Entity type is not found, instead of
{
"code": 400,
"message": "Invalid service type dashboard for the chart"
}
Thanks
Activity
harshach commentedon Oct 5, 2021
Thanks for finding the bug @pmbrull
Fix #680: Service Type checks should ignore case
harshach commentedon Oct 6, 2021
@pmbrull issue was we are ignoring the case serviceType during the creation of entity but in adding href we are checking the case with switch. I made it consistent across the checks . Please add your review #683
pmbrull commentedon Oct 6, 2021
Amazing nice catch, thanks!
Fix #680: Service Type checks should ignore case (#683)