* Upgrade Pax Web from 8.0.33 to 8.0.34
* Upgrade Jetty from 9.4.57 to 9.4.58
* Upgrade log4j-api from 2.0.16 to 2.0.17
This was missed when Karaf was upgraded to 4.4.9 in #5195.
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
* [REST] API /file-format/parse: do not extend thing/channel config
The /file-format/parse API does no more extend the thing and channel configuration with parameters having a default value. The output will contain hte thing/channel configuration parameters provided in the input.
It is fixed for YAML and DSL formats.
Unit tests added for YAML models containing Thing
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
* Fix test failures in DiscoveryServiceRegistryOSGiTest
Follow-up to #5307. Apply the fix to more test cases.
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
* Initial plan
* Fix Mockito verification failures in DiscoveryServiceRegistryOSGiTest
Add reset(discoveryListenerMock) after addDiscoveryListener() in both testRemoveOlderResultsOnlySameService() and testRemoveOlderResultsOnlyOfSpecificBridge() to clear the mock invocation counter after cached results are replayed.
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: holgerfriedrich <2121139+holgerfriedrich@users.noreply.github.com>
* Support deserializing short-form metadata in YamlMetadataDTO
So we can set
`metadata: value`
instead of
```
metadata:
value: value
```
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Catch IAE during Thing configuration loading to prevent
the entire file from failing. Errors are now logged as warnings
instead of throwing a full stack trace.
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
- 'config' in RootUIComponent/UIComponent was of the wrong type in openapi spec
- getType accessor in UIComponent generated a property
- Updated the naming of data structures in openapi spec w/o the internal DTO nomenclature for consistency and simplicity
Also-by: Florian Hotze <dev@florianhotze.com>
Also-by: Wouter Born <github@maindrain.net>
Signed-off-by: Jeff James <jeff@james-online.com>
When a client disconnected while receiving the icon byte stream response,
an error and a warning were logged, making users worried:
```
2022-08-15 20:09:31.387 [ERROR] [ab.core.ui.icon.internal.IconServlet] - Failed sending the icon byte stream as a response: null
2022-08-15 20:09:31.390 [WARN ] [org.eclipse.jetty.server.HttpChannel] - /icon/autarky
java.lang.IllegalStateException: ABORTED
at org.eclipse.jetty.server.HttpChannelState.sendError(HttpChannelState.java:915) ~[?:?]
...
```
IMO, there is no need to log at ERROR or WARN level in such cases,
so I decided to reduce to DEBUG logging.
The following script can be used to reproduce the above case:
```python
import socket
import struct
host = 'localhost'
port = 8080
path = '/icon/BatteryLevel?format=svg&anyFormat=true&state=94+%25&iconset=classic'
request = f"GET {path} HTTP/1.1\r\nHost: {host}\r\nConnection: keep-alive\r\n\r\n"
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
# Send the request
s.sendall(request.encode())
# FORCE an immediate hard reset (RST)
# This ensures the server sees a connection failure while it's inside doGet
s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack('ii', 1, 0))
s.close()
```
Signed-off-by: Florian Hotze <dev@florianhotze.com>
* SimpleRule: Improve code wrt null handling & annotations
* SimpleRule: Fix adding type and source config throws validation error in RuleRegistryImpl
Define those two as "default" config description as the UI uses those fields to display the source.
Fixes#5268.
Signed-off-by: Florian Hotze <dev@florianhotze.com>
* [YAML provider] Add INFO log for config TEXT param value not parsed as string
Related to openhab/openhab-webui#3696
Follow-up #5248
A log at level INFO is now displayed when a YAML file is loaded and contains a thing or channel configuration parameter of type TEXT whose value is not parsed as a string. This occurs when an unquoted number is provided. The log recommends enclosing the value in double quotes to prevent conversion.
For better consistency, the YAML provider is now also processing any BigDecimal value to convert it into a String type when the config paramater is of type TEXT.
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
* Upgrade pdfbox from to 3.0.1
Upgrade Apache pdfbox from 2.0.27 to 3.0.1.
* Exclude junit due to launcher incompatibility
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Upgrade com.jayway.jsonpath:json-path from 2.9.0 to 2.10.0,
including the following dependencies:
Upgrade net.minidev:accessors-smart and net.minidev:json-smart to from 2.5.0
to 2.6.0. Removes transitive CVE-2024-57699.
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Fixes#4395.
The issue was noticed for Rules DSL, but not for JS Scripting, because JS Scripting is loaded at a point where the rule engine is already started.
Signed-off-by: Florian Hotze <dev@florianhotze.com>
This PR normalizes thing/channel configuration before producing the response.
It allows having proper types for config parameters in the JSON response of the API.
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
* [YAML provider] Add special handling to thing/channel config param of type text
Related to openhab/openhab-webui#3696
For configuration parameter of type text only, if the value in YAML is an unquoted number (value is then of type BigDecimal after loading and mapping in our DTO) and there is no decimal, we convert it to an integer and return a String from that integer.
Value 1 in YAML is converted into String "1"
Value 1.0 in YAML is converted into String "1"
Value 1.5 in YAML is untouched
Value "1" in YAML is untouched
Value "1.0" in YAML is untouched
Value "1.5" in YAML is untouched
All this is to avoid that 1 filled in YAML without quotes finally results in string "1.0" after configuration normalization.
Signed-off-by: Laurent Garnier <lg.hc@free.fr>