package org.wildfly.swarm.examples.jaxrs.swagger;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import io.swagger.annotations.*;
import javax.ws.rs.core.MediaType;

import org.joda.time.DateTime;

@Path("/time")
@Api(value = "/time", description = "Get the time", tags = "time")
@Produces(MediaType.APPLICATION_JSON)
public class TimeResource {

    @GET
    @Path("/now")
    @ApiOperation(value = "Get the current time",
            notes = "Returns the time as a string",
            response = String.class
    )
    @Produces(MediaType.APPLICATION_JSON)
    public String get() {
        return "The time is " + new DateTime();
    }
}

@@ -626,16 +626,45 @@
  return 
+String.format(%22%7B%5C%22value%5C%22 : %5C
 %22The tim
@@ -672,11 +672,15 @@
  is 
-%22 +
+%25s%5C%22%7D%22,
  new
@@ -690,16 +690,17 @@
 teTime()
+)
 ;%0A    %7D%0A

Change the format into json because Swagger UI requires strict JSON