Skip to content

Commit

Permalink
[fj-doc-maven-plugin] goal init,
Browse files Browse the repository at this point in the history
added openapi documentation for flavour 'micronaut-4'
  • Loading branch information
fugerit79 committed Sep 10, 2024
1 parent 360955b commit a3e9d30
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- [fj-doc-maven-plugin] goal init, added openapi documentation for flavour 'micronaut-4'
- [fj-doc-maven-plugin] goal init, added openapi documentation for flavour 'springboot-3'
- [fj-doc-playground-quarkus] added venus version 8.8.1 and 8.8.2 to doc project init

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,33 @@
@APIResponse(responseCode = "200", description = "The ${outputDescription} document content" )
@APIResponse(responseCode = "500", description = "In case of an unexpected error" )
@Tags( { @Tag( name = "document" ), @Tag( name = "${outputDescription?lower_case}" ) } )
@Operation( operationId = "${outputDescription}Example", summary = "Generates an example ${outputDescription} document using Fugerit Venus Doc handler" )
@Operation( operationId = "${outputDescription}Example", summary = "Example ${outputDescription} generation",
description = "Generates an example ${outputDescription} document using Fugerit Venus Doc handler" )
@GET
@Produces("${outputMime}")
@Path("/example.${outputExtension}")
<@createPathMethod context=context outputMime=outputMime outputExtension=outputExtension outputDescription=outputDescription/>
</#macro>

<#macro createMicronautPath context outputMime outputExtension outputDescription>
@Get(uri="/example.${outputExtension}", produces="${outputMime}")
<@createPathMethod context=context outputMime=outputMime outputExtension=outputExtension outputDescription=outputDescription/>
</#macro>

<#-- using https://javadoc.io/doc/io.swagger.core.v3/swagger-annotations/latest/index.html -->
<#macro createSpringBootPath context outputMime outputExtension outputDescription>
<#macro createOpenAPIDoc context outputMime outputExtension outputDescription>
@Operation( method = "GET", operationId = "${outputDescription}Example", tags = { "document", "${outputDescription?lower_case}" },
summary = "Generates an example ${outputDescription} document using Fugerit Venus Doc handler" )
summary = "Example ${outputDescription} generation",
description = "Generates an example ${outputDescription} document using Fugerit Venus Doc handler" )
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "The ${outputDescription} document content", content = { @Content(mediaType = "${outputMime}") } ),
@ApiResponse(responseCode = "500", description = "In case of an unexpected error" )
})
</#macro>

<#macro createMicronautPath context outputMime outputExtension outputDescription>
<@createOpenAPIDoc context=context outputMime=outputMime outputExtension=outputExtension outputDescription=outputDescription/>
@Get(uri="/example.${outputExtension}", produces="${outputMime}")
<@createPathMethod context=context outputMime=outputMime outputExtension=outputExtension outputDescription=outputDescription/>
</#macro>

<#macro createSpringBootPath context outputMime outputExtension outputDescription>
<@createOpenAPIDoc context=context outputMime=outputMime outputExtension=outputExtension outputDescription=outputDescription/>
@GetMapping(value = "/example.${outputExtension}", produces = "${outputMime}" )
<@createPathMethod context=context outputMime=outputMime outputExtension=outputExtension outputDescription=outputDescription/>
</#macro>
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
<#import '../flavour-macro.ftl' as fhm>
package <@fhm.toProjectPackage context=context/>;

import io.micronaut.http.annotation.*;

import org.fugerit.java.core.cfg.ConfigRuntimeException;

import lombok.extern.slf4j.Slf4j;
import org.fugerit.java.doc.base.config.DocConfig;
import org.fugerit.java.doc.base.process.DocProcessContext;

import java.io.ByteArrayOutputStream;
import java.util.Arrays;
import java.util.List;

import io.micronaut.http.annotation.*;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.media.Content;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Controller("/doc")
public class DocController {
Expand Down

0 comments on commit a3e9d30

Please sign in to comment.