Page 1 of 1

Incorrect API response type

Posted: Thu Dec 23, 2021 09:10
by HiiragiNil
Hi, thank you for adding REST API! This could be gamechanger for developers.
I'm working on developing REST API with Golang(https://github.com/FlowingSPDG/resolume-go).

I found that "value" field in "BooleanParameter" struct is not actual boolean value.
When I access http://localhost:8080/api/v1/composition , Actual BooleanParameter value is "Empty", which is not boolean.

I'm still trying to find more possible bugs, will post here if I found any.

Re: Incorrect API response type

Posted: Fri Dec 31, 2021 12:57
by Zoltán
"bypassed":{"valuetype":"ParamBoolean","id":1640951645300,"value":false} is what I see a lot.

Do you have a specific composition where it says empty for you for bool?

Re: Incorrect API response type

Posted: Tue Jan 04, 2022 23:53
by HiiragiNil
This bug can be replicated on MacOS Catalina 10.15.7 with Resolume Arena v7.8.0.
I had this bug on example project (/Users/flowingspdg/Documents/Resolume Arena/Compositions/Example.avc).

Here is full JSON response of /api/v1/composition .
https://pastebin.ubuntu.com/p/J2gtKCDdkm/plain/


I guess "Clip" has incorrect type.
layers.clips.connected type should be "BooleanParameter" but it has "ParamState" type, which is not defined in swagger.

"connected":{
"id":1641335430528,
"valuetype":"ParamState",
"options":[
"Empty",
"Disconnected",
"Previewing",
"Connected",
"Connected & previewing"
],
"index":1,
"value":"Disconnected",
"id":1641335430527
},

https://user-images.githubusercontent.c ... 3e122f.png
https://user-images.githubusercontent.c ... ac7800.png
https://user-images.githubusercontent.c ... fbf9c3.png

Re: Incorrect API response type

Posted: Wed Jan 05, 2022 14:26
by Zoltán
A clip slot can be connected multiple ways, like the list explains. It should not be a bool.

Re: Incorrect API response type

Posted: Thu Jan 06, 2022 07:27
by HiiragiNil
I see, okay then I need correct swagger yaml for generating correct typed codes.
The problem is not if its bool or not, it is different type from swagger.yaml's type definition.
My Go project codes are generated automatically by reading swagger's types, so if type is not matched my code will be broken. Otherwise I have to fix them by myself, which means swagger is not working.

Re: Incorrect API response type

Posted: Thu Jan 06, 2022 14:15
by Zoltán
Hmm, I see what you mean now.
I'll make a ticket.

Re: Incorrect API response type

Posted: Thu Jan 06, 2022 16:50
by HiiragiNil
Thank you! imo swagger is best API definition tool because many tool supports auto code generation.
I just wanted to tell you it is awesome to have auto-generate work for many programmers/developers.
API looks game changer for resolume users, thanks and keep it up! ;)