Bug description
When using the api to get a list of dashboards, the api returns a different response than the spec defines. I noticed this particularly with the results.owners
property. The spec specifies an object returned but you actually get an array back of these user2 objects.
Not a huge issue but did cause some problems when using a generated client to make these API requests. Attached screenshots below.
Screenshots/recordings
Superset version
4.1.2
Python version
I don't know
Node version
I don't know
Browser
Not applicable
Additional context
No response
Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Comment From: dosubot[bot]
Hi @igotagood1! I'm Dosu and I’m helping the superset team.
The backend and schema for the /api/v1/dashboard endpoint both define the owners property as an array (list) of user objects, not as a single object. The actual API response matches this definition, so there is no evidence in the codebase or schema that owners should ever be an object. This means the mismatch you’re seeing is likely due to an issue with the OpenAPI/Swagger documentation generation or how your client interprets the spec, not a bug in the API implementation itself.
If you’re using a generated client, you may need to manually adjust the spec or the client code to expect an array for owners. Double-check the OpenAPI spec file being used for client generation—if it incorrectly defines owners as an object, updating it to an array of user objects should resolve the issue. There are no recent changes or known issues in the repo addressing this, so if the problem persists in the official OpenAPI spec, it’s likely a documentation tooling bug rather than an API bug.
For reference, the schema and serialization logic for owners as an array can be seen in the code: - DashboardGetResponseSchema in dashboards/schemas.py - API response construction in dashboards/api.py
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
Comment From: rusackas
Curious if you think the bot is correct here. CC @Vitor-Avila in case he knows this API better than I do ;)