Santo
Santo
JCHJava Community | Help. Code. Learn.
Created by Santo on 12/2/2024 in #java-help
Gradle H2 issue with MSSQLServer Mode
When liquibase runs runs the SQL files on the H2, it encounters Syntax issues like sp_rename The issue is not present in the branch that's still multi modular
8 replies
JCHJava Community | Help. Code. Learn.
Created by Santo on 12/2/2024 in #java-help
Gradle H2 issue with MSSQLServer Mode
Any idea on what could explain/cause this ?
8 replies
JCHJava Community | Help. Code. Learn.
Created by Santo on 2/14/2024 in #java-help
OpenAPI-Swagger webflux Spring boot 3
Idk why ... normally that's what's written in the doc, or it's not up to date
45 replies
JCHJava Community | Help. Code. Learn.
Created by Santo on 2/14/2024 in #java-help
OpenAPI-Swagger webflux Spring boot 3
Found the culprit ... I removed the following (beanClass and beanMethod everywhere) and now everything shows
beanClass = IngredientService.class, beanMethod = "getAllIngredients"
beanClass = IngredientService.class, beanMethod = "getAllIngredients"
45 replies
JCHJava Community | Help. Code. Learn.
Created by Santo on 2/14/2024 in #java-help
OpenAPI-Swagger webflux Spring boot 3
yes
45 replies
JCHJava Community | Help. Code. Learn.
Created by Santo on 2/14/2024 in #java-help
OpenAPI-Swagger webflux Spring boot 3
if i remove the second route the first one shows up yeah
45 replies
JCHJava Community | Help. Code. Learn.
Created by Santo on 2/14/2024 in #java-help
OpenAPI-Swagger webflux Spring boot 3
this is the recommanded way for spring boot 3 😅 but yeah i'll try
45 replies
JCHJava Community | Help. Code. Learn.
Created by Santo on 2/14/2024 in #java-help
OpenAPI-Swagger webflux Spring boot 3
Maybe it's a bug ... i'll try downgrading the version
45 replies
JCHJava Community | Help. Code. Learn.
Created by Santo on 2/14/2024 in #java-help
OpenAPI-Swagger webflux Spring boot 3
nope
45 replies
JCHJava Community | Help. Code. Learn.
Created by Santo on 2/14/2024 in #java-help
OpenAPI-Swagger webflux Spring boot 3
it's already there :
@RouterOperation(path = BASE_URL, produces = {MediaType.APPLICATION_JSON_VALUE}, method = RequestMethod.GET, beanClass = IngredientService.class, beanMethod = "getAllIngredients",
operation = @Operation(operationId = "getAllIngredients", responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Ingredient.class)))})),
@RouterOperation(path = BASE_URL, produces = {MediaType.APPLICATION_JSON_VALUE}, method = RequestMethod.GET, beanClass = IngredientService.class, beanMethod = "getAllIngredients",
operation = @Operation(operationId = "getAllIngredients", responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Ingredient.class)))})),
45 replies
JCHJava Community | Help. Code. Learn.
Created by Santo on 2/14/2024 in #java-help
OpenAPI-Swagger webflux Spring boot 3
no, even separating the RouterFunctions into multiple methods with a routeroperation each, the problem persists
45 replies
JCHJava Community | Help. Code. Learn.
Created by Santo on 2/14/2024 in #java-help
OpenAPI-Swagger webflux Spring boot 3
https://springdoc.org/features.html I tried their way here :
@RouterOperations({ @RouterOperation(path = "/getAllPersons", beanClass = PersonService.class, beanMethod = "getAll"),
@RouterOperation(path = "/getPerson/{id}", beanClass = PersonService.class, beanMethod = "getById"),
@RouterOperation(path = "/createPerson", beanClass = PersonService.class, beanMethod = "save"),
@RouterOperation(path = "/deletePerson/{id}", beanClass = PersonService.class, beanMethod = "delete") })
@Bean
public RouterFunction<ServerResponse> personRoute(PersonHandler handler) {
return RouterFunctions
.route(GET("/getAllPersons").and(accept(MediaType.APPLICATION_JSON)), handler::findAll)
.andRoute(GET("/getPerson/{id}").and(accept(MediaType.APPLICATION_STREAM_JSON)), handler::findById)
.andRoute(POST("/createPerson").and(accept(MediaType.APPLICATION_JSON)), handler::save)
.andRoute(DELETE("/deletePerson/{id}").and(accept(MediaType.APPLICATION_JSON)), handler::delete);
}
@RouterOperations({ @RouterOperation(path = "/getAllPersons", beanClass = PersonService.class, beanMethod = "getAll"),
@RouterOperation(path = "/getPerson/{id}", beanClass = PersonService.class, beanMethod = "getById"),
@RouterOperation(path = "/createPerson", beanClass = PersonService.class, beanMethod = "save"),
@RouterOperation(path = "/deletePerson/{id}", beanClass = PersonService.class, beanMethod = "delete") })
@Bean
public RouterFunction<ServerResponse> personRoute(PersonHandler handler) {
return RouterFunctions
.route(GET("/getAllPersons").and(accept(MediaType.APPLICATION_JSON)), handler::findAll)
.andRoute(GET("/getPerson/{id}").and(accept(MediaType.APPLICATION_STREAM_JSON)), handler::findById)
.andRoute(POST("/createPerson").and(accept(MediaType.APPLICATION_JSON)), handler::save)
.andRoute(DELETE("/deletePerson/{id}").and(accept(MediaType.APPLICATION_JSON)), handler::delete);
}
45 replies
JCHJava Community | Help. Code. Learn.
Created by Santo on 2/14/2024 in #java-help
OpenAPI-Swagger webflux Spring boot 3
I'm pretty sad with this compared to when the detection was automatic with RestController :/
45 replies
JCHJava Community | Help. Code. Learn.
Created by Santo on 2/14/2024 in #java-help
OpenAPI-Swagger webflux Spring boot 3
The swagger doesn't automatically detect the routes, I have to use the @Operation for it to detect it
45 replies
JCHJava Community | Help. Code. Learn.
Created by Santo on 2/14/2024 in #java-help
OpenAPI-Swagger webflux Spring boot 3
No description
45 replies
JCHJava Community | Help. Code. Learn.
Created by Santo on 2/14/2024 in #java-help
OpenAPI-Swagger webflux Spring boot 3
No description
45 replies
JCHJava Community | Help. Code. Learn.
Created by Santo on 2/14/2024 in #java-help
OpenAPI-Swagger webflux Spring boot 3
it seems to detect only one route
45 replies
JCHJava Community | Help. Code. Learn.
Created by Santo on 2/14/2024 in #java-help
OpenAPI-Swagger webflux Spring boot 3
No description
45 replies
JCHJava Community | Help. Code. Learn.
Created by Santo on 2/14/2024 in #java-help
OpenAPI-Swagger webflux Spring boot 3
RouterFunctions.route(GET(BASE_URL) ... Apparently this is the way today for reactive programming and endpoint declaration
45 replies
JCHJava Community | Help. Code. Learn.
Created by Santo on 2/14/2024 in #java-help
OpenAPI-Swagger webflux Spring boot 3
You can find the source code here : https://github.com/Hunikel/Cocktail-API This is the router (equivalent to Controllers from what I understood with ReactiveProgramming) : https://github.com/Hunikel/Cocktail-API/blob/main/src/main/java/com/santo/cocktail/router/IngredientRouter.java
45 replies