PMT-2: Switch Generator Implementation to a more fitting one
This commit is contained in:
parent
fd6356517e
commit
af6b251f74
4 changed files with 27 additions and 20 deletions
|
@ -61,7 +61,7 @@ dependencies {
|
|||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
||||
|
||||
//OAS
|
||||
swaggerCodegen("org.openapitools:openapi-generator-cli:7.8.0")
|
||||
swaggerCodegen("io.swagger.codegen.v3:swagger-codegen-cli:3.0.61")
|
||||
implementation("io.swagger.core.v3:swagger-annotations:2.2.22")
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ swaggerSources {
|
|||
val validationTask = validation
|
||||
code(delegateClosureOf<GenerateSwaggerCode> {
|
||||
language = "spring"
|
||||
components = listOf("models", "apis", "supportingFiles=ApiUtil.java")
|
||||
components = listOf("models", "apis")
|
||||
code.rawOptions =
|
||||
listOf("--ignore-file-override=" + file("${rootDir}/src/main/resources/.codegen-ignore").absolutePath)
|
||||
dependsOn(validationTask)
|
||||
|
|
|
@ -1,17 +1,31 @@
|
|||
package de.hmmh.pmt;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import de.hmmh.pmt.oas.DefaultApi;
|
||||
import de.hmmh.pmt.oas.HelloOut;
|
||||
import de.hmmh.pmt.oas.models.HelloOut;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("${openapi.projectManagement.base-path:/api/v1}")
|
||||
public class ApiController implements DefaultApi {
|
||||
|
||||
|
||||
@Override
|
||||
public ResponseEntity<HelloOut> getHello() throws Exception {
|
||||
public Optional<ObjectMapper> getObjectMapper() {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<HttpServletRequest> getRequest() {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<HelloOut> getHello() {
|
||||
HelloOut hello = new HelloOut();
|
||||
hello.setMsg("Hello World");
|
||||
return ResponseEntity.ok(hello);
|
||||
|
|
|
@ -1,20 +1,13 @@
|
|||
{
|
||||
"library": "spring-boot",
|
||||
"dateLibrary": "java8",
|
||||
"hideGenerationTimestamp": true,
|
||||
"modelPackage": "de.hmmh.pmt.oas",
|
||||
"modelPackage": "de.hmmh.pmt.oas.models",
|
||||
"apiPackage": "de.hmmh.pmt.oas",
|
||||
"invokerPackage": "de.hmmh.pmt.oas",
|
||||
"serializableModel": true,
|
||||
"openApiNullable": false,
|
||||
"useTags": true,
|
||||
"useGzipFeature": true,
|
||||
"unhandledException": true,
|
||||
"useSpringBoot3": true,
|
||||
"useSwaggerUI": true,
|
||||
"importMappings": {
|
||||
"ResourceSupport": "org.springframework.hateoas.RepresentationModel",
|
||||
"Link": "org.springframework.hateoas.Link"
|
||||
}
|
||||
"java8": false,
|
||||
"java11": true,
|
||||
"dateLibrary": "java11",
|
||||
"library": "spring-boot3",
|
||||
"defaultInterfaces": false,
|
||||
"hideGenerationTimestamp": true,
|
||||
"serializableModel": true
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue