diff --git a/service/pom.xml b/service/pom.xml index 527fb013..27d7d2ea 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -104,14 +104,14 @@ org.thymeleaf thymeleaf-spring6 - - org.webjars - bootstrap - - - org.webjars - jquery - + + + + + + + + diff --git a/service/src/main/java/gdv/xport/srv/config/AppConfig.java b/service/src/main/java/gdv/xport/srv/config/AppConfig.java index 18c61d2b..54f63a01 100644 --- a/service/src/main/java/gdv/xport/srv/config/AppConfig.java +++ b/service/src/main/java/gdv/xport/srv/config/AppConfig.java @@ -68,10 +68,10 @@ public void addInterceptors(InterceptorRegistry registry) { */ @Override public void configureMessageConverters(List> converters) { - // see https://github.com/springdoc/springdoc-openapi/issues/624 + // see https://github.com/springdoc/springdoc-openapi/issues/2143 converters.add(new StringHttpMessageConverter()); - converters.add(new MappingJackson2HttpMessageConverter()); converters.add(new ByteArrayHttpMessageConverter()); + converters.add(new MappingJackson2HttpMessageConverter()); converters.add(new DatenpaketHttpMessageConverter(MediaType.TEXT_HTML)); converters.add(new DatenpaketHttpMessageConverter(MediaType.TEXT_XML, MediaType.APPLICATION_XML)); converters.add(new DatenpaketHttpMessageConverter(MediaType.TEXT_PLAIN)); diff --git a/service/src/main/java/gdv/xport/srv/config/SwaggerConfig.java b/service/src/main/java/gdv/xport/srv/config/SwaggerConfig.java index 8f315a41..0cf1e9f4 100644 --- a/service/src/main/java/gdv/xport/srv/config/SwaggerConfig.java +++ b/service/src/main/java/gdv/xport/srv/config/SwaggerConfig.java @@ -36,7 +36,7 @@ @Configuration public class SwaggerConfig { - @Value("${application.version: application.version}") + @Value("${spring.application.version: 7.0}") private String version; @Bean diff --git a/service/src/main/java/gdv/xport/srv/web/DatenpaketController.java b/service/src/main/java/gdv/xport/srv/web/DatenpaketController.java index 43a5ec6c..249aff44 100644 --- a/service/src/main/java/gdv/xport/srv/web/DatenpaketController.java +++ b/service/src/main/java/gdv/xport/srv/web/DatenpaketController.java @@ -23,6 +23,7 @@ import gdv.xport.util.URLReader; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; +import jakarta.servlet.http.HttpServletRequest; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; @@ -39,7 +40,6 @@ import patterntesting.runtime.log.LogWatch; import patterntesting.runtime.util.Converter; -import jakarta.servlet.http.HttpServletRequest; import java.io.IOException; import java.net.MalformedURLException; import java.net.URI; @@ -93,7 +93,7 @@ public final class DatenpaketController { @PostMapping("/v1/Abweichungen") public @ResponseBody List validate( - @Parameter(description = "Datenpaket im GDV-Format (alternativ als Parameter)") @RequestParam(required = false) String text, + @Parameter(description = "Datenpaket im GDV-Format (alternativ als Parameter)") @RequestParam(value = "text", required = false) String text, HttpServletRequest request) throws IOException { String body = IOUtils.toString(request.getInputStream(), StandardCharsets.ISO_8859_1); String content = (StringUtils.isBlank(text)) ? body : text; @@ -111,7 +111,7 @@ List validate( @Operation(summary = "validiert den eingegebenen Text im GDV-Format und gibt die gefundenen Abweichungen zurueck") @PostMapping("/v1/Abweichungen/form") public List validate( - @Parameter(description = "Eingabe-Formular mit Text im GDV-Format") @RequestParam MultiValueMap map) { + @Parameter(description = "Eingabe-Formular mit Text im GDV-Format") @RequestParam("map") MultiValueMap map) { String content = Objects.toString(map.getFirst("text"), ""); return validate(content); } @@ -167,7 +167,7 @@ private List validate(String content) { example = "http://www.gdv-online.de/vuvm/musterdatei_bestand/musterdatei_041222.txt") @RequestParam("uri") URI uri, @Parameter(description = "Ausgabe-Format (HTML, XML, JSON, CSV oder TEXT);" + " normalerweise wird das Format ueber den Accept-Header vorgegeben, kann aber hierueber explizit gesetzt werden.", - example = "JSON") @RequestParam(required = false) String format, + example = "JSON") @RequestParam(value = "format", required = false) String format, HttpServletRequest request) throws IOException { String content = readFrom(uri); return getDatenpaketResponseEntity(format, content, request); @@ -190,7 +190,7 @@ private List validate(String content) { return service.importDatenpaket(content); } - private static String readFrom(@RequestParam("uri") URI uri) throws IOException { + private static String readFrom(URI uri) throws IOException { LogWatch watch = new LogWatch(); LOG.info("Reading Datenpakete from {}...", uri); URLReader urlReader = new URLReader(uri.toURL()); @@ -284,12 +284,12 @@ private ResponseEntity getDatenpaketResponseEntity(String format, St @Operation(summary = "dient zum Laden und Anzeigen einer Datei im GDV-Format") @PostMapping("/v1/Datenpaket/uploaded") public @ResponseBody Datenpaket uploadDatenpaket ( - @RequestParam("file") MultipartFile file) throws IOException { + @RequestParam MultipartFile file) throws IOException { String text = readFrom(file); return importDatenpaketFrom(text); } - private String readFrom(@RequestParam("file") MultipartFile file) throws IOException { + private String readFrom(MultipartFile file) throws IOException { LogWatch watch = new LogWatch(); LOG.info("Reading Datenpakete from {}...", file); String text = new String(file.getBytes()); diff --git a/service/src/main/resources/application.properties b/service/src/main/resources/application.properties index e00b3f46..45cda592 100644 --- a/service/src/main/resources/application.properties +++ b/service/src/main/resources/application.properties @@ -11,5 +11,8 @@ spring.profiles.active=default server.port=2517 springdoc.api-docs.path=/v3/api-docs +springdoc.swagger-ui.url=/v3/api-docs springdoc.swagger-ui.config-url=/v3/api-docs/swagger-config springdoc.writer-with-default-pretty-printer=true + +server.forward-headers-strategy=framework \ No newline at end of file