Incorrect Swagger reference in Branding API model SimpleImageResponse
Hi DRACOON,
First of all, I'm using DRACOON cloud. Current versions at moment of creating this issue are 4.20.3 (core) and 1.3.1 (branding).
I just found an issue in your Swagger reference for the Branding API. I recently added Branding API endpoints to my development fork of your C# SDK. I implemented all the models according to the Swagger reference available at /branding/api/swagger-ui.html#. While I can use the branding colors without any problems, I realized that I'm not getting any valid image information to use the CI logo for example.
After some debugging I found that the Branding API response from GET /v1/branding differs from what is documented in Swagger. According to Swagger reference, the images are part of result as noticed:
{
[...],
"images": [
// collection of SimpleImageResponse instances
],
[...]
}
Where SimpleImageResponse is defined as following:
{
"id": /* integer($int64) */,
"type": /* string */,
"url": /* string */
}
However, the actual result from the GET /v1/branding route describes the images with the following model:
{
"type": /* string, as declared in SimpleImageResponse */,
"files": [
// collection of ImageFileResponse as described below
]
}
Where ImageFileResponse (name invented by myself) is:
{
"size": /* string, one of "small", "medium" or "large" */,
"url": /* string, the URL to the image */
}
=========
In fact, with this knowledge, it's just a simple task to adapt the different response to the SDK. However, you guys may want to correct the Swagger reference.
Best regards,
Sebastian
-
Offizieller Kommentar
Hi Sebastian,
Thanks for contacting us.
However, I'm not able to reproduce your issue (I analyzed Branding Service v. 1.3.1). Please note that we have two different GET APIs (for different purposes) that do not use identical models:
GET /v1/branding (Model is UpdateBrandingResponse which contains a list of images with the model SimpleImageResponse) and GET /v1/public/branding (Model is CacheableBrandingResponse which contains a list of images with the model CacheableBrandingImageResponse). The latter is the response model you actually got in your snippets above; the former one is the one you expected.
Documented models and actually returned models were the same in my tests. Did I miss something?
Thanks for your support!
FlorianAktionen für Kommentare -
Hi Florian,
you're absolutely right. Indeed, I missed that there are different models for images property in CacheableBrandingResponse and UpdateBrandingResponse. Your documentation in Swagger defines both models exactly as their corresponding actual response.
TL;DR: My mistake, issue can be closed.
Mea culpa,
Sebastian
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
3 Kommentare