[SOLVED] openHAB REST API: swagger.json Error

Hey,
I have a question about the rest API of openhab. I would like to control openhab with a software that requires the swagger file of the API. I get this via the following call: http://openhabianpi:8080/rest/swagger.json
My software gives me an error. To check the swagger file, I opened it in the swagger editor ( http://editor.swagger.io/ ), where I also see the same errors:

Schema error at info
should have required property ‘version’
missingProperty: version
Jump to line 2
Semantic error at paths./channel-types.get.operationId
Operations must have unique operationIds.
Jump to line 119
Semantic error at paths./config-descriptions.get.operationId
Operations must have unique operationIds.
Jump to line 196
Semantic error at paths./iconsets.get.operationId
Operations must have unique operationIds.
Jump to line 457
Semantic error at paths./inbox.get.operationId
Operations must have unique operationIds.
Jump to line 474
Semantic error at paths./links.get.operationId
Operations must have unique operationIds.
Jump to line 983
Semantic error at paths./services.get.operationId
Operations must have unique operationIds.
Jump to line 1243
Semantic error at paths./services/{serviceId}.get.operationId
Operations must have unique operationIds.
Jump to line 1260
Semantic error at paths./services/{serviceId}/config.get.operationId
Operations must have unique operationIds.
Jump to line 1282
Semantic error at paths./services/{serviceId}/config.put.operationId
Operations must have unique operationIds.
Jump to line 1303
Semantic error at paths./thing-types.get.operationId
Operations must have unique operationIds.
Jump to line 1512
Semantic error at paths./thing-types/{thingTypeUID}.get.operationId
Operations must have unique operationIds.
Jump to line 1535
Semantic error at paths./things.get.operationId
Operations must have unique operationIds.
Jump to line 1562
Semantic error at paths./things/{thingUID}.get.operationId
Operations must have unique operationIds.
Jump to line 1614
Semantic error at paths./things/{thingUID}/config.put.operationId
Operations must have unique operationIds.
Jump to line 1707
Semantic error at paths./voice/interpreters/{id}.post.operationId
Operations must have unique operationIds.
Jump to line 1957

Does anyone know how to fix the errors?

Kind regards

Hi Max,

I ran into the same errors and fixed them myself.
You can find the fixed version here:

I’m not sure though, how this could be fixed directly in the sources.

Regards,
Andreas

2 Likes