1

I'm using a SpringBoot 2.2.6 WebApplication with Maven 3. I'm also using spring-integration-http for my endpoint, that's mean that my endpoint are similar to follow:

@Bean
public IntegrationFlow test(CommonTransformer<TestDTO, String, TestMapper> testTransformer, Jackson2JsonObjectMapper obj) {
    return IntegrationFlows.from(Http.inboundGateway("/foo/{name}")
            .requestMapping(m -> m.methods(HttpMethod.GET))
            .payloadExpression("#pathVariables.name")
            .replyChannel(Constants.REPLY)
            .requestPayloadType(String.class))
            .transform(testTransformer)
            .transform(new ObjectToJsonTransformer(obj))
            .channel(Constants.HTTP_REQUEST)
            .get();
}

Now I would like to create a OpenApi docs for my endpoint and, if it's possible, a swagger GUI interface to test it.

I have read several official/unofficial docs and I find interesting docs here another much interesting example here.

My preoccupation is that many of this articles are dated before 2020 (for example one of these use deprecated annotation likes @EnableSwagger2Mvc) but I can't managed to find out something more updated.

Is anyone aware of a more up-to-date procedure?

-------------------------- UPDATE --------------------------

First of all Thanks @ArtemBilan for yor response.

Yes I read that article and I'm not new to documenting my REST API. With springdoc-openapi-ui I'm able to create a .json file that, if putted in some editor like http://swagger.io or if used with a specific maven plugin can create a client (in both spring java and Angular language) ready for use.

I have tried the springfox way (above) to documenting my spring-integration-http but it sucks! It generate some useless files to reproduce the call via CURL..

Is not what I'm looking for. I must (the STO asks) documenting my endpoint like the .yaml you can find for the example Swagger Pet Store.

And it seems there's no way with this spring-integration-http to do so..

Any help is appreciate.

CoderJammer
  • 599
  • 3
  • 8
  • 27
  • Have you tried this one: https://spring.io/projects/spring-restdocs? I'm not familiar with the project, but looks like it should lead to an up-to-date API. – Artem Bilan Jun 22 '22 at 16:02

0 Answers0