You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we have a resource with content-type application/ld+json and we get a request with accept header application/json, the ContentTypeReplacer is going to identify that this is a valid response.
But if we have a resource with content-type text/turtle, an error is going to be thrown that the request is not supported, even though we could provide a valid response by converting that turtle to json.
One possible solution would be for the ContentTypeReplacer to update the incoming preferences to also include support the types it is configured with. E.g., in the example above it would see that the preferences contain application/json, and would thus add application/ld+json to the preferences. We would have to make sure this doens't override any of the other preferences, and make sure the original one is still preferred.
Specifically the case above could also be solved by making our media type matcher smarter so that it can detect that application/ld+json is an instance of application/json but this might not catch all cases. It would for example not be possible to detect that way that application/n-triples is a valid response when text/turtle has been requested.
Another option would be to have the ContentTypeReplacer be part of the ChainedConverter inputs. But then some modifications would be needed so it is a TypedRepresentationConverter (or the interface there has to change).
Activity
jvherweg commentedon Oct 22, 2021
Another option would be to have the
ContentTypeReplacerbe part of theChainedConverterinputs. But then some modifications would be needed so it is aTypedRepresentationConverter(or the interface there has to change).jvherweg commentedon Nov 8, 2021
Done in #1030. Will be part of v3.0.0 release.