-
Notifications
You must be signed in to change notification settings - Fork 88
Description
I was following the starter template. I created my own thing and serving it worked well. You can find it on gist. Except, that the forms attribute of my action has changed. It got changed to some apparently standard forms attribute. The console output was the following:
"actions":{"takePhoto":{"title":"takePhoto","description":"description","input":{"unit":"","type":"string"},"forms":[{"href":"http://192.168.8.128:8080/KWH2/actions/takePhoto","contentType":"application/json","op":["invokeaction"],"htv:methodName":"POST"}],"idempotent":false,"safe":false}},
the contentType of my action got changed from image/jpeg to application/json. I tracked the issue down a bit and figured out it happens when i call exposedthing.expose()
. More detailed in getServient().expose(_this)
https://github.com/eclipse/thingweb.node-wot/blob/6854ab79022a7c71ee627a6f77a23e0eaaa9d702/packages/core/src/exposed-thing.ts#L99
At this point the _thing still contains the proper form attribute with the image/jpeg.
But then in Servient.expose() Line 133 you are going to overwrite it.
https://github.com/eclipse/thingweb.node-wot/blob/6854ab79022a7c71ee627a6f77a23e0eaaa9d702/packages/core/src/servient.ts#L115-L137
Is this behavior wanted or is this a bug?