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