package org.example.shelf.controller;

import org.hildan.livedoc.core.annotations.auth.ApiAuthBasic;
import org.hildan.livedoc.core.annotations.auth.ApiAuthBasicUser;
import org.hildan.livedoc.springmvc.controller.JsonLivedocController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@ApiAuthBasic(testUsers = {
        @ApiAuthBasicUser(username = "testuser", password = "password")
})
@Controller
@RequestMapping("/secure")
public class SecureDocController {

    /**
     * This endpoint is an example of authenticated jsondoc endpoint.
     * <p>
     * It simply forwards to the {@link JsonLivedocController} added by livedoc-springboot, but requires authentication.
     *
     * @return the Livedoc documentation in the form of a JSON body
     */
    @GetMapping("/jsondoc")
    public String jsondoc() {
        return "forward:/jsondoc";
    }
}

@@ -32,16 +32,80 @@
 oller;%0A%0A
+import org.hildan.livedoc.core.annotations.ApiResponseBodyType;%0A
 import o
@@ -254,48 +254,169 @@
 doc.
-springmvc.controller.JsonLivedocControll
+core.model.doc.Livedoc;%0Aimport org.hildan.livedoc.springmvc.controller.JsonLivedocController;%0Aimport org.hildan.livedoc.springmvc.converter.LivedocMessageConvert
 er;%0A
@@ -1075,16 +1075,24 @@
 Mapping(
+value = 
 %22/jsondo
@@ -1093,17 +1093,165 @@
 jsondoc%22
-)
+, produces = LivedocMessageConverter.APPLICATION_LIVEDOC)%0A    @ApiResponseBodyType(Livedoc.class) // the String is a forward, Livedoc can't know that
 %0A    pub

Fix return type of fowarded secure livedoc handler in Sample App