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")
|
||||
|
||||
//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")
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ swaggerSources {
|
|||
val validationTask = validation
|
||||
code(delegateClosureOf<GenerateSwaggerCode> {
|
||||
language = "spring"
|
||||
components = listOf("models", "apis")
|
||||
components = listOf("models", "apis", "supportingFiles=ApiUtil.java")
|
||||
code.rawOptions =
|
||||
listOf("--ignore-file-override=" + file("${rootDir}/src/main/resources/.codegen-ignore").absolutePath)
|
||||
dependsOn(validationTask)
|
||||
|
|
|
@ -1,31 +1,17 @@
|
|||
package de.hmmh.pmt;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import de.hmmh.pmt.oas.DefaultApi;
|
||||
import de.hmmh.pmt.oas.models.HelloOut;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import de.hmmh.pmt.oas.HelloOut;
|
||||
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 Optional<ObjectMapper> getObjectMapper() {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<HttpServletRequest> getRequest() {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<HelloOut> getHello() {
|
||||
public ResponseEntity<HelloOut> getHello() throws Exception {
|
||||
HelloOut hello = new HelloOut();
|
||||
hello.setMsg("Hello World");
|
||||
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",
|
||||
"invokerPackage": "de.hmmh.pmt.oas",
|
||||
"java8": false,
|
||||
"java11": true,
|
||||
"dateLibrary": "java11",
|
||||
"library": "spring-boot3",
|
||||
"defaultInterfaces": false,
|
||||
"hideGenerationTimestamp": true,
|
||||
"serializableModel": true
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue