eclipse-lyo / lyo

Eclipse Lyo, a Java SDK for OSLC-based tool integration
https://oslc.github.io/developing-oslc-applications/eclipse_lyo/eclipse-lyo.html
Eclipse Public License 2.0
17 stars 17 forks source link

Deprecated Json4J Providers still registered. Usage by default cannot be prevented #636

Closed jhemm2 closed 4 weeks ago

jhemm2 commented 1 month ago

The Providers from the Json4JProvidersRegistryare deprecated but still registered by default. This behavior cannot be prevented when using the default OslcClient. This leads to malformed json when the OslcRdfJsonProvideris used as MessageBodyWriter.

This issue occurs since lyo 6.0.0 but may have been in there earlier.

Provide an option to prevent registration of providers by default and to add them manually when needed.

berezovskyi commented 1 month ago

Thanks, the PR looks good and this is a good issue to fix -- approved, let's wait till Jad had time to check it out.

Many years ago I had a number of similar problems - but from the OSLC Server side, needing to have pure JSON/XML endpoints. As a result, I made some changes/workarounds but did not merge them in the end because there was no user feedback and I did not want to break something that worked for all users. If you are interested / need it, I will be happy if you pick up those changes, change them as you see fit and submit as a PR: