Repository navigation
Move content type replacement and if needed conversion to ChainedConverter - #1030
Conversation
| "@type": "WaterfallHandler", | ||
| "handlers": [ | ||
| { "@id": "urn:solid-server:default:MarkdownToHtmlConverter" }, | ||
| { "@id": "urn:solid-server:default:DynamicJsonToTemplateConverter" }, |
There was a problem hiding this comment.
Why still this one though? Maybe just get rid of the waterfall?
There was a problem hiding this comment.
The DynamicJsonToTemplateConverter is a special case because its output types depend on the metadata of the incoming Representation (it extracts templates from that) so it doesn't work as a TypedRepresentationConverter unfortunately. Currently this one is only used to generate the HTML templates in the IDP component.
There was a problem hiding this comment.
This comment made me realize that there actually is an issue with this converter now. If you request application/json from the IDP you're still going to get JSON, but if you request application/json, text/html;q=0.5 you're going to get html. It's easy to fix it in that class but it is unfortunate that this is not part of the conversion chain.
There was a problem hiding this comment.
And application/json is obviously a lie, because the content type is more specific 🙂
But good to leave as-is.
1504130 to
b51a771
Compare
Closes #756, closes #834.
Related to #1024. Wanted to push this so it could be part of the discussion there.
This PR changes the
TypedRepresentationConverterclass functions so it's probably a major semver change? Will need to make sure this gets merged to the correct branch!ChainedConverternow starts from a path of length 0 and potentially uses that if it is a good solution for the requested preferences. It also checks thecanHandlecall of its converters now (which requires us making dummy metadata unfortunately).Updated the
RdfToQuadConverterso it likes all inputs equally when generating quads. Otherwise theContentTypeReplacerwould change the turtle to trig first because trig had a higher value.Stole the integration tests from #1024.