Commit 01e0baa5 authored by LAVENIER's avatar LAVENIER
Browse files

[fix] Extraction: doc use HTML by default

parent b103f560
......@@ -175,11 +175,11 @@ public class ExtractionGraphQLService {
@GraphQLQuery(name = "docUrl", description = "Get extraction documentation URL")
public String getDocUrl(@GraphQLContext ExtractionTypeVO type) {
if (type.getDocUrl() == null) return type.getDocUrl();
if (type.getDocUrl() != null) return type.getDocUrl();
if (documentationUrl != null && type.getCategory() != null && type.getLabel() != null) {
String docUrl = documentationUrl.replace("{category}", type.getCategory().name().toLowerCase())
.replace("{label[^}]*}", type.getLabel().toLowerCase());
String docUrl = documentationUrl.replaceFirst("\\{category[^\\}]*\\}", type.getCategory().name().toLowerCase())
.replaceFirst("\\{label[^\\}]*\\}", type.getLabel().toLowerCase());
type.setDocUrl(docUrl);
return docUrl;
}
......
......@@ -165,11 +165,11 @@ public class ExtractionRestController {
final HttpServletRequest request) {
Preconditions.checkArgument(StringUtils.isNotBlank(category) && StringUtils.isNotBlank(label), "Invalid path. Expected: '/extraction/<lire|product>/<label>/doc'");
// GSet user locale
// Set user locale
Locale locale = getLocale(request);
// Find output format
MediaType mediaType = getMediaType(request, userFormat, MediaType.TEXT_MARKDOWN);
// Find output format (default: HTML)
MediaType mediaType = getMediaType(request, userFormat, MediaType.TEXT_HTML);
ExtractionTypeVO type = ExtractionTypeVO.builder()
.category(ExtractionCategoryEnum.valueOfIgnoreCase(category))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment