I am currently trying out the mailu rest API and I found that the generated swagger.json file doesn't seem to be correct. For the endpoint GET /alias/destination/{domain} the response type is of the type
"schema": {
"$ref": "#/definitions/Alias"
}
For the endpoint GET /alias/ the response type is:
Clearly both api endpoints can return multiple aliases. Still only GET /alias/ (per definition) returns an array and GET /alias/destination/{domain} should only return a single alias. This is of course not the case as both return arrays.
I assume the get function lacks the decorator @alias.doc('list_alias'):
Open the swagger docs at yourMailuInstance/api/v1/swagger.json
Check the return types of certain api endpoints
Observed behaviour
There are wrong types for different api endpoints in the swagger docs. Specifically the /alias/destination/{domain} endpoint defines a #/definitions/Alias instead of an array of said type.
Expected behaviour
The /alias/destination/{domain} endpoint should define an array return type. This is especially necessary for code generators that generate api clients based on the swagger documentation.
Environment & Version
Docker Compose version v2.21.0
2.0.36
Description
I am currently trying out the mailu rest API and I found that the generated swagger.json file doesn't seem to be correct. For the endpoint
GET /alias/destination/{domain}
the response type is of the typeFor the endpoint
GET /alias/
the response type is:Clearly both api endpoints can return multiple aliases. Still only
GET /alias/
(per definition) returns an array andGET /alias/destination/{domain}
should only return a single alias. This is of course not the case as both return arrays.I assume the get function lacks the decorator
@alias.doc('list_alias')
:https://github.com/Mailu/Mailu/blob/cc59be41e15c085270b52f49739398236c131827/core/admin/mailu/api/v1/alias.py#L112-L117
Replication Steps
yourMailuInstance/api/v1/swagger.json
Observed behaviour
There are wrong types for different api endpoints in the swagger docs. Specifically the
/alias/destination/{domain}
endpoint defines a#/definitions/Alias
instead of an array of said type.Expected behaviour
The
/alias/destination/{domain}
endpoint should define an array return type. This is especially necessary for code generators that generate api clients based on the swagger documentation.Logs
No logs needed