Details
-
Bug
-
Resolution: Fixed
-
Major
-
13.10
-
None
Description
The canonical usage is:
@Inject
private ResourceReferenceSerializer<ResourceReference, ExtendedURL> serializer;
...
TemporaryResourceReference tmpReference = ...
serializer.serialize(tmpReference);
This automatically uses the correct URL scheme.
However it fails since ExtendedURLTemporaryResourceReferenceSerializer has the wrong hint.
This is forcing code to use the wrong:
@Inject @Named("standard/tmp") private ResourceReferenceSerializer<TemporaryResourceReference, ExtendedURL> serializer;
Examples outside of platform:
- https://github.com/xwiki-contrib/macro-plantuml/blob/a7d6446ec25b7e2300a592089d16559bb4d8bc98/macro-plantuml-macro/src/main/java/org/xwiki/contrib/plantuml/internal/store/TemporaryImageWriter.java#L67-L69
- https://github.com/xwiki-contrib/macro-kroki/blob/a4c4f81972540b9a0e1bac3b46141e2f56b8a854/macro-kroki-api/src/main/java/org/xwiki/contrib/kroki/internal/macro/KrokiMacro.java#L76-L79