diff --git a/springdoc-openapi-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java b/springdoc-openapi-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java index 6791e486f..28c222047 100644 --- a/springdoc-openapi-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java +++ b/springdoc-openapi-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java @@ -315,7 +315,7 @@ protected synchronized OpenAPI getOpenApi(Locale locale) { Map findControllerAdvice = openAPIService.getControllerAdviceMap(); // calculate generic responses openApi = openAPIService.getCalculatedOpenAPI(); - if (springDocConfigProperties.isOverrideWithGenericResponse()) { + if (springDocConfigProperties.isOverrideWithGenericResponse() || springDocConfigProperties.isOverrideWithGenericResponseIfDeclared()) { if (!CollectionUtils.isEmpty(mappingsMap)) findControllerAdvice.putAll(mappingsMap); responseBuilder.buildGenericResponse(openApi.getComponents(), findControllerAdvice, finalLocale); @@ -463,8 +463,18 @@ protected void calculatePath(HandlerMethod handlerMethod, RouterOperation router // get javadoc method description if (javadocProvider != null) { String description = javadocProvider.getMethodJavadocDescription(handlerMethod.getMethod()); - if (!StringUtils.isEmpty(description) && StringUtils.isEmpty(operation.getDescription())) + String summary = javadocProvider.getFirstSentence(description); + boolean emptyOverrideDescription = StringUtils.isEmpty(operation.getDescription()); + boolean emptyOverrideSummary = StringUtils.isEmpty(operation.getSummary()); + if (!StringUtils.isEmpty(description) && emptyOverrideDescription) { operation.setDescription(description); + } + // if there is a previously set description + // but no summary then it is intentional + // we keep it as is + if (!StringUtils.isEmpty(summary) && emptyOverrideSummary && emptyOverrideDescription) { + operation.setSummary(javadocProvider.getFirstSentence(description)); + } } Set apiCallbacks = AnnotatedElementUtils.findMergedRepeatableAnnotations(method, io.swagger.v3.oas.annotations.callbacks.Callback.class); diff --git a/springdoc-openapi-common/src/main/java/org/springdoc/core/GenericResponseService.java b/springdoc-openapi-common/src/main/java/org/springdoc/core/GenericResponseService.java index bd06e2d3b..2fd94eb1e 100644 --- a/springdoc-openapi-common/src/main/java/org/springdoc/core/GenericResponseService.java +++ b/springdoc-openapi-common/src/main/java/org/springdoc/core/GenericResponseService.java @@ -22,10 +22,12 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Method; +import java.lang.reflect.Parameter; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; @@ -62,6 +64,7 @@ import org.springframework.web.method.ControllerAdviceBean; import org.springframework.web.method.HandlerMethod; +import static java.util.Arrays.asList; import static org.springdoc.core.Constants.DEFAULT_DESCRIPTION; import static org.springdoc.core.SpringDocAnnotationsUtils.extractSchema; import static org.springdoc.core.SpringDocAnnotationsUtils.getContent; @@ -73,6 +76,11 @@ * @author bnasslahsen */ public class GenericResponseService { + /** + * This extension name is used to temporary store + * the exception classes. + */ + private static final String EXTENSION_EXCEPTION_CLASSES = "x-exception-class"; /** * The Operation builder. @@ -133,7 +141,11 @@ public GenericResponseService(OperationService operationService, List genericMapResponse = getGenericMapResponse(handlerMethod.getBeanType()); + if (springDocConfigProperties.isOverrideWithGenericResponseIfDeclared()) { + genericMapResponse = filterAndEnrichGenericMapResponseByDeclarations(handlerMethod, genericMapResponse); + } + ApiResponses apiResponses = methodAttributes.calculateGenericMapResponse(genericMapResponse); //Then use the apiResponses from documentation ApiResponses apiResponsesFromDoc = operation.getResponses(); if (!CollectionUtils.isEmpty(apiResponsesFromDoc)) @@ -145,6 +157,41 @@ public ApiResponses build(Components components, HandlerMethod handlerMethod, Op return apiResponses; } + /** + * Filters the generic API responses by the declared exceptions. + * If Javadoc comment found for the declaration than it overrides the default description. + * + * @param handlerMethod the method which can have exception declarations + * @param genericMapResponse the default generic API responses + * @return the filtered and enriched responses + */ + private Map filterAndEnrichGenericMapResponseByDeclarations(HandlerMethod handlerMethod, Map genericMapResponse) { + Map result = new HashMap<>(); + for (Map.Entry genericResponse : genericMapResponse.entrySet()) { + Map extensions = genericResponse.getValue().getExtensions(); + Set> genericExceptions = (Set>) extensions.get(EXTENSION_EXCEPTION_CLASSES); + for (Class declaredException : handlerMethod.getMethod().getExceptionTypes()) { + if (genericExceptions.contains(declaredException)) { + ApiResponse clone = cloneApiResponse(genericResponse.getValue()); + clone.getExtensions().remove(EXTENSION_EXCEPTION_CLASSES); + if (operationService.getJavadocProvider() != null) { + JavadocProvider javadocProvider = operationService.getJavadocProvider(); + Map javadocThrows = javadocProvider.getMethodJavadocThrows(handlerMethod.getMethod()); + String description = javadocThrows.get(declaredException.getName()); + if (description == null) { + description = javadocThrows.get(declaredException.getSimpleName()); + } + if (description != null && !description.trim().isEmpty()) { + clone.setDescription(description); + } + } + result.put(genericResponse.getKey(), clone); + } + } + } + return result; + } + /** * Build generic response. * @@ -502,6 +549,23 @@ else if (CollectionUtils.isEmpty(apiResponse.getContent())) if (schemaN != null && ArrayUtils.isNotEmpty(methodAttributes.getMethodProduces())) Arrays.stream(methodAttributes.getMethodProduces()).forEach(mediaTypeStr -> mergeSchema(existingContent, schemaN, mediaTypeStr)); } + if (springDocConfigProperties.isOverrideWithGenericResponseIfDeclared() + && methodParameter.getExecutable().isAnnotationPresent(ExceptionHandler.class)) { + // ExceptionHandler's exception class resolution is non-trivial + // more info on its javadoc + ExceptionHandler exceptionHandler = methodParameter.getExecutable().getAnnotation(ExceptionHandler.class); + Set> exceptions = new HashSet<>(); + if (exceptionHandler.value().length == 0) { + for (Parameter parameter : methodParameter.getExecutable().getParameters()) { + if (Throwable.class.isAssignableFrom(parameter.getType())) { + exceptions.add(parameter.getType()); + } + } + } else { + exceptions.addAll(asList(exceptionHandler.value())); + } + apiResponse.addExtension(EXTENSION_EXCEPTION_CLASSES, exceptions); + } apiResponsesOp.addApiResponse(httpCode, apiResponse); } @@ -620,4 +684,15 @@ private boolean isHttpCodePresent(String httpCode, Set responseEntityExceptionHandlerClass) { GenericResponseService.responseEntityExceptionHandlerClass = responseEntityExceptionHandlerClass; } + + private ApiResponse cloneApiResponse(ApiResponse original) { + ApiResponse clone = new ApiResponse(); + clone.set$ref(original.get$ref()); + clone.setDescription(original.getDescription()); + clone.setContent(original.getContent()); + clone.setHeaders(original.getHeaders() == null ? null : new HashMap<>(original.getHeaders())); + clone.setExtensions(original.getExtensions() == null ? null : new HashMap<>(original.getExtensions())); + clone.setLinks(original.getLinks() == null ? null : new HashMap<>(original.getLinks())); + return clone; + } } diff --git a/springdoc-openapi-common/src/main/java/org/springdoc/core/OpenAPIService.java b/springdoc-openapi-common/src/main/java/org/springdoc/core/OpenAPIService.java index ad23e01af..327ffdf75 100644 --- a/springdoc-openapi-common/src/main/java/org/springdoc/core/OpenAPIService.java +++ b/springdoc-openapi-common/src/main/java/org/springdoc/core/OpenAPIService.java @@ -57,6 +57,7 @@ import org.slf4j.LoggerFactory; import org.springdoc.core.customizers.OpenApiBuilderCustomizer; import org.springdoc.core.customizers.ServerBaseUrlCustomizer; +import org.springdoc.core.providers.JavadocProvider; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.BeanDefinition; @@ -155,6 +156,11 @@ public class OpenAPIService implements ApplicationContextAware { */ private PropertyResolverUtils propertyResolverUtils; + /** + * The javadoc provider. + */ + private Optional javadocProvider; + /** * The Basic error controller. */ @@ -189,7 +195,8 @@ public class OpenAPIService implements ApplicationContextAware { public OpenAPIService(Optional openAPI, SecurityService securityParser, SpringDocConfigProperties springDocConfigProperties, PropertyResolverUtils propertyResolverUtils, Optional> openApiBuilderCustomizers, - Optional> serverBaseUrlCustomizers) { + Optional> serverBaseUrlCustomizers, + Optional javadocProvider) { if (openAPI.isPresent()) { this.openAPI = openAPI.get(); if (this.openAPI.getComponents() == null) @@ -204,6 +211,7 @@ public OpenAPIService(Optional openAPI, SecurityService securityParser, this.springDocConfigProperties = springDocConfigProperties; this.openApiBuilderCustomisers = openApiBuilderCustomizers; this.serverBaseUrlCustomizers = serverBaseUrlCustomizers; + this.javadocProvider = javadocProvider; if (springDocConfigProperties.isUseFqn()) TypeNameResolver.std.setUseFqn(true); } @@ -348,8 +356,21 @@ public Operation buildTags(HandlerMethod handlerMethod, Operation operation, Ope } } - if (isAutoTagClasses(operation)) - operation.addTagsItem(splitCamelCase(handlerMethod.getBeanType().getSimpleName())); + if (isAutoTagClasses(operation)) { + String tagAutoName = splitCamelCase(handlerMethod.getBeanType().getSimpleName()); + operation.addTagsItem(tagAutoName); + if (javadocProvider.isPresent()) { + String description = javadocProvider.get().getClassJavadoc(handlerMethod.getBeanType()); + if (StringUtils.isNotBlank(description)) { + io.swagger.v3.oas.models.tags.Tag tag = new io.swagger.v3.oas.models.tags.Tag(); + tag.setName(tagAutoName); + tag.setDescription(description); + if (openAPI.getTags() == null || !openAPI.getTags().contains(tag)) { + openAPI.addTagsItem(tag); + } + } + } + } if (!CollectionUtils.isEmpty(tags)) { // Existing tags @@ -733,7 +754,7 @@ public SecurityService getSecurityParser() { /** * Gets server base URL - * + * * @return the server base URL */ public String getServerBaseUrl() { diff --git a/springdoc-openapi-common/src/main/java/org/springdoc/core/SpringDocConfigProperties.java b/springdoc-openapi-common/src/main/java/org/springdoc/core/SpringDocConfigProperties.java index d7f6948ce..9cf376a83 100644 --- a/springdoc-openapi-common/src/main/java/org/springdoc/core/SpringDocConfigProperties.java +++ b/springdoc-openapi-common/src/main/java/org/springdoc/core/SpringDocConfigProperties.java @@ -117,6 +117,11 @@ public class SpringDocConfigProperties { */ private boolean overrideWithGenericResponse = true; + /** + * The Override with generic response only if the exception is declared + */ + private boolean overrideWithGenericResponseIfDeclared = false; + /** * The Remove broken reference definitions. */ @@ -592,6 +597,24 @@ public void setOverrideWithGenericResponse(boolean overrideWithGenericResponse) this.overrideWithGenericResponse = overrideWithGenericResponse; } + /** + * Is override with generic response if declared boolean. + * + * @return the boolean + */ + public boolean isOverrideWithGenericResponseIfDeclared() { + return overrideWithGenericResponseIfDeclared; + } + + /** + * Sets override with generic response if declared. + * + * @param overrideWithGenericResponseIfDeclared the override with generic response if declared + */ + public void setOverrideWithGenericResponseIfDeclared(boolean overrideWithGenericResponseIfDeclared) { + this.overrideWithGenericResponseIfDeclared = overrideWithGenericResponseIfDeclared; + } + /** * Is remove broken reference definitions boolean. * diff --git a/springdoc-openapi-common/src/main/java/org/springdoc/core/SpringDocConfiguration.java b/springdoc-openapi-common/src/main/java/org/springdoc/core/SpringDocConfiguration.java index 85296fc8b..b8e7e1eab 100644 --- a/springdoc-openapi-common/src/main/java/org/springdoc/core/SpringDocConfiguration.java +++ b/springdoc-openapi-common/src/main/java/org/springdoc/core/SpringDocConfiguration.java @@ -228,8 +228,8 @@ OpenAPIService openAPIBuilder(Optional openAPI, SecurityService securityParser, SpringDocConfigProperties springDocConfigProperties,PropertyResolverUtils propertyResolverUtils, Optional> openApiBuilderCustomisers, - Optional> serverBaseUrlCustomisers) { - return new OpenAPIService(openAPI, securityParser, springDocConfigProperties, propertyResolverUtils, openApiBuilderCustomisers, serverBaseUrlCustomisers); + Optional> serverBaseUrlCustomisers, Optional javadocProvider) { + return new OpenAPIService(openAPI, securityParser, springDocConfigProperties, propertyResolverUtils, openApiBuilderCustomisers, serverBaseUrlCustomisers, javadocProvider); } /** diff --git a/springdoc-openapi-common/src/main/java/org/springdoc/core/providers/JavadocProvider.java b/springdoc-openapi-common/src/main/java/org/springdoc/core/providers/JavadocProvider.java index a7a12d99a..00d677c53 100644 --- a/springdoc-openapi-common/src/main/java/org/springdoc/core/providers/JavadocProvider.java +++ b/springdoc-openapi-common/src/main/java/org/springdoc/core/providers/JavadocProvider.java @@ -22,6 +22,7 @@ import java.lang.reflect.Field; import java.lang.reflect.Method; +import java.util.Map; /** * The interface Javadoc provider. @@ -29,6 +30,14 @@ */ public interface JavadocProvider { + /** + * Gets class description. + * + * @param cl the class + * @return the class description + */ + String getClassJavadoc(Class cl); + /** * Gets method description. * @@ -45,6 +54,14 @@ public interface JavadocProvider { */ String getMethodJavadocReturn(Method method); + /** + * Gets method throws declaration. + * + * @param method the method + * @return the method throws (name-description map) + */ + Map getMethodJavadocThrows(Method method); + /** * Gets param javadoc. * @@ -55,5 +72,12 @@ public interface JavadocProvider { String getParamJavadoc(Method method, String name); String getFieldJavadoc(Field field); + + /** + * Returns the first sentence of a javadoc comment. + * @param text the javadoc comment's text + * @return the first sentence based on javadoc guidelines + */ + String getFirstSentence(String text); } diff --git a/springdoc-openapi-javadoc/src/main/java/org/springdoc/openapi/javadoc/JavadocPropertyCustomizer.java b/springdoc-openapi-javadoc/src/main/java/org/springdoc/openapi/javadoc/JavadocPropertyCustomizer.java index ad681c950..0638934ca 100644 --- a/springdoc-openapi-javadoc/src/main/java/org/springdoc/openapi/javadoc/JavadocPropertyCustomizer.java +++ b/springdoc-openapi-javadoc/src/main/java/org/springdoc/openapi/javadoc/JavadocPropertyCustomizer.java @@ -76,12 +76,12 @@ public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterato if (!CollectionUtils.isEmpty(fields)) { if (!type.isSchemaProperty()) { Schema existingSchema = context.resolve(type); - setJavadocDescription(fields, existingSchema); + setJavadocDescription(cls, fields, existingSchema); } else if (resolvedSchema != null && resolvedSchema.get$ref() != null && resolvedSchema.get$ref().contains(AnnotationsUtils.COMPONENTS_REF)) { String schemaName = resolvedSchema.get$ref().substring(21); Schema existingSchema = context.getDefinedModels().get(schemaName); - setJavadocDescription(fields, existingSchema); + setJavadocDescription(cls, fields, existingSchema); } } return resolvedSchema; @@ -96,8 +96,11 @@ else if (resolvedSchema != null && resolvedSchema.get$ref() != null && resolvedS * @param fields the fields * @param existingSchema the existing schema */ - private void setJavadocDescription(List fields, Schema existingSchema) { + private void setJavadocDescription(Class cls, List fields, Schema existingSchema) { if (existingSchema != null) { + if (StringUtils.isBlank(existingSchema.getDescription())) { + existingSchema.setDescription(javadocProvider.getClassJavadoc(cls)); + } Map properties = existingSchema.getProperties(); if (!CollectionUtils.isEmpty(properties)) properties.entrySet().stream() diff --git a/springdoc-openapi-javadoc/src/main/java/org/springdoc/openapi/javadoc/SpringDocJavadocProvider.java b/springdoc-openapi-javadoc/src/main/java/org/springdoc/openapi/javadoc/SpringDocJavadocProvider.java index cad7556f0..7555d85b4 100644 --- a/springdoc-openapi-javadoc/src/main/java/org/springdoc/openapi/javadoc/SpringDocJavadocProvider.java +++ b/springdoc-openapi-javadoc/src/main/java/org/springdoc/openapi/javadoc/SpringDocJavadocProvider.java @@ -23,14 +23,15 @@ import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.List; +import java.util.Map; -import com.github.therapi.runtimejavadoc.CommentFormatter; -import com.github.therapi.runtimejavadoc.FieldJavadoc; -import com.github.therapi.runtimejavadoc.MethodJavadoc; -import com.github.therapi.runtimejavadoc.ParamJavadoc; -import com.github.therapi.runtimejavadoc.RuntimeJavadoc; +import com.github.therapi.runtimejavadoc.*; +import org.apache.commons.lang3.StringUtils; import org.springdoc.core.providers.JavadocProvider; +import static java.lang.Math.min; +import static java.util.stream.Collectors.toMap; + /** * The type Spring doc javadoc provider. * @author bnasslahsen @@ -42,6 +43,19 @@ public class SpringDocJavadocProvider implements JavadocProvider { */ private final CommentFormatter formatter = new CommentFormatter(); + + /** + * Gets class description. + * + * @param cl the class + * @return the class description + */ + @Override + public String getClassJavadoc(Class cl) { + ClassJavadoc classJavadoc = RuntimeJavadoc.getJavadoc(cl); + return formatter.format(classJavadoc.getComment()); + } + /** * Gets method javadoc description. * @@ -66,6 +80,19 @@ public String getMethodJavadocReturn(Method method) { return formatter.format(methodJavadoc.getReturns()); } + /** + * Gets method throws declaration. + * + * @param method the method + * @return the method throws (name-description map) + */ + public Map getMethodJavadocThrows(Method method) { + return RuntimeJavadoc.getJavadoc(method) + .getThrows() + .stream() + .collect(toMap(ThrowsJavadoc::getName, javadoc -> formatter.format(javadoc.getComment()))); + } + /** * Gets param javadoc. * @@ -93,4 +120,31 @@ public String getFieldJavadoc(Field field) { return formatter.format(fieldJavadoc.getComment()); } + @Override + public String getFirstSentence(String text) { + if (StringUtils.isEmpty(text)) { + return text; + } + int pOpenIndex = text.indexOf("

"); + int pCloseIndex = text.indexOf("

"); + int dotIndex = text.indexOf("."); + if (pOpenIndex != -1) { + if (pOpenIndex == 0 && pCloseIndex != -1) { + if (dotIndex != -1) { + return text.substring(3, min(pCloseIndex, dotIndex)); + } + return text.substring(3, pCloseIndex); + } + if (dotIndex != -1) { + return text.substring(0, min(pOpenIndex, dotIndex)); + } + return text.substring(0, pOpenIndex); + } + if (dotIndex != -1 + && text.length() != dotIndex + 1 + && Character.isWhitespace(text.charAt(dotIndex + 1))) { + return text.substring(0, dotIndex + 1); + } + return text; + } } diff --git a/springdoc-openapi-javadoc/src/test/java/org/springdoc/openapi/javadoc/SpringDocJavadocProviderTest.java b/springdoc-openapi-javadoc/src/test/java/org/springdoc/openapi/javadoc/SpringDocJavadocProviderTest.java new file mode 100644 index 000000000..6c42822e7 --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/java/org/springdoc/openapi/javadoc/SpringDocJavadocProviderTest.java @@ -0,0 +1,60 @@ +package org.springdoc.openapi.javadoc; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.springdoc.core.providers.JavadocProvider; + +import java.util.stream.Stream; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.params.provider.Arguments.arguments; + +class SpringDocJavadocProviderTest { + private JavadocProvider javadocProvider; + + @BeforeEach + public void setup() { + javadocProvider = new SpringDocJavadocProvider(); + } + + @ParameterizedTest + @MethodSource + public void getFirstSentence(String javadoc, String expectedFirstSentence) { + assertThat(javadocProvider.getFirstSentence(javadoc)) + .isEqualTo(expectedFirstSentence); + } + + static Stream getFirstSentence() { + return Stream.of( + arguments(null, null), + arguments("", ""), + arguments("A b c. D e f", "A b c."), + arguments("A b c", "A b c"), + arguments("A b c

D e f", "A b c"), + arguments("A b c. D

e f", "A b c"), + arguments("A b c

D. e f", "A b c"), + arguments("

A b c

D e f", "A b c"), + arguments("

A b c. D

e f", "A b c"), + arguments("A b c.d e f", "A b c.d e f") + ); + } + + @ParameterizedTest + @MethodSource + public void getFirstSentenceNotHandled(String javadoc, String correctFirstSentence) { + assertThat(javadocProvider.getFirstSentence(javadoc)) + .isNotEqualTo(correctFirstSentence); + } + + /** + * Edge cases not handled by the implementation. + */ + static Stream getFirstSentenceNotHandled() { + return Stream.of( + arguments("

A b c

d e f

", "A b c") + ); + } + +} \ No newline at end of file diff --git a/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app162/SpringDocApp162Test.java b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app162/SpringDocApp162Test.java new file mode 100644 index 000000000..a208eb120 --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app162/SpringDocApp162Test.java @@ -0,0 +1,38 @@ +package test.org.springdoc.api.app162; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; +import test.org.springdoc.api.AbstractSpringDocTest; + +/** + * The type Spring doc app 162 test. + */ +@TestPropertySource(properties = "springdoc.override-with-generic-response-if-declared=true") +public class SpringDocApp162Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info() + .title("SpringShop API") + .version("v1") + .description("The description of the api")); + } + + } + + +} diff --git a/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app162/exception/NoResultException.java b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app162/exception/NoResultException.java new file mode 100644 index 000000000..3af9a55f7 --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app162/exception/NoResultException.java @@ -0,0 +1,4 @@ +package test.org.springdoc.api.app162.exception; + +public class NoResultException extends RuntimeException { +} diff --git a/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app162/exception/NonUniqueResultException.java b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app162/exception/NonUniqueResultException.java new file mode 100644 index 000000000..697ff9a04 --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app162/exception/NonUniqueResultException.java @@ -0,0 +1,7 @@ +package test.org.springdoc.api.app162.exception; + +/** + * Multiple results found instead of a unique result. + */ +public class NonUniqueResultException extends RuntimeException{ +} diff --git a/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app162/rest/JavadocOnlyRestController.java b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app162/rest/JavadocOnlyRestController.java new file mode 100644 index 000000000..cddb4412c --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app162/rest/JavadocOnlyRestController.java @@ -0,0 +1,82 @@ +package test.org.springdoc.api.app162.rest; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; +import test.org.springdoc.api.app162.exception.NoResultException; +import test.org.springdoc.api.app162.exception.NonUniqueResultException; +import test.org.springdoc.api.app162.rest.dto.JavadocOnlyRestDto; + +import java.util.List; + +/** + * This is the {@code JavadocOnlyRestController} class javadoc. + */ +@RestController +@RequestMapping("/javadoc-only") +public class JavadocOnlyRestController { + /** + * This is the create method's javadoc. + * The method's signature: {@code #create(JavadocOnlyRestDto)} + * + * @param input the {@code @param input} javadoc for the {@code #create(JavadocOnlyRestDto)} method + * @return the {@code @return} javadoc for the {@code #create(JavadocOnlyRestDto)} method + */ + @PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(HttpStatus.CREATED) + public ResponseEntity create(@RequestBody JavadocOnlyRestDto input) { + return new ResponseEntity<>(HttpStatus.CREATED); + } + + /** + * This is the update method's javadoc. + * The method's signature: {@code #update(String, JavadocOnlyRestDto)} + * + * @param guid the {@code @param input} javadoc for the {@code #update(String, JavadocOnlyRestDto)} method + * @return the {@code @return} javadoc for the {@code #update(String, JavadocOnlyRestDto)} method + */ + @PutMapping(path = "{guid}", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(HttpStatus.OK) + public ResponseEntity update(@PathVariable String guid, @RequestBody JavadocOnlyRestDto input) throws NoResultException { + return new ResponseEntity<>(HttpStatus.CREATED); + } + + /** + * This is the list method's javadoc. + * The method's signature: {@code #list()} + * + * @return the {@code @return} javadoc for the {@code #list()} method + */ + @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity> list() { + return new ResponseEntity<>(HttpStatus.OK); + } + + /** + * This is the find method's javadoc. + * The method's signature: {@code #find(String)} + * + * @param guid the {@code @param guid} javadoc for the {@code #find(String)} method + * @return the {@code @return} javadoc for the {@code #find(String)} method + * @throws NoResultException the {@code @throws NoResultException} javadoc for the {@code #find(String)} method + */ + @GetMapping(path = "{guid}", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity find(@PathVariable String guid) throws NoResultException { + return new ResponseEntity<>(HttpStatus.OK); + } + + /** + * This is the findStartsBy method's javadoc. + * The method's signature: {@code #findStartsBy(String)} + * + * @param prefix the {@code @param prefix} javadoc for the {@code #findStartsBy(String)} method + * @return the {@code @return} javadoc for the {@code #findStartsBy(String)} method + * @throws NoResultException the {@code @throws NoResultException} javadoc for the {@code #findStartsBy(String)} method + * @throws NonUniqueResultException the {@code @throws NonUniqueResultException} javadoc for the {@code #findStartsBy(String)} method + */ + @GetMapping(path = "startsBy/{prefix}", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity findStartsBy(@PathVariable String prefix) throws NoResultException, NonUniqueResultException { + return new ResponseEntity<>(HttpStatus.OK); + } +} diff --git a/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app162/rest/dto/JavadocOnlyRestDto.java b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app162/rest/dto/JavadocOnlyRestDto.java new file mode 100644 index 000000000..297e704a4 --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app162/rest/dto/JavadocOnlyRestDto.java @@ -0,0 +1,58 @@ +package test.org.springdoc.api.app162.rest.dto; + +/** + * This is the {@code JavadocOnlyRestDto} class javadoc. + */ +public class JavadocOnlyRestDto { + /** + * This is the private {@code #guid} field's javadoc. + */ + private String guid; + /** + * This is the private {@code #inner} field's javadoc. + * + * This javadoc description is ignored by the REST documentation: + * the {@code $ref} can't have a description as any sibling elements of a $ref are ignored. + */ + private JavadocOnlyStaticInnerRestDto inner; + + public JavadocOnlyRestDto() { + } + + public String getGuid() { + return guid; + } + + public void setGuid(String guid) { + this.guid = guid; + } + + public JavadocOnlyStaticInnerRestDto getInner() { + return inner; + } + + public void setInner(JavadocOnlyStaticInnerRestDto inner) { + this.inner = inner; + } + + /** + * This is the {@code JavadocOnlyStaticInnerRestDto} class javadoc. + */ + public static class JavadocOnlyStaticInnerRestDto { + /** + * This is the private {@code #content} field's javadoc. + */ + private String content; + + public JavadocOnlyStaticInnerRestDto() { + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + } +} diff --git a/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app162/rest/util/RestExceptionHandler.java b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app162/rest/util/RestExceptionHandler.java new file mode 100644 index 000000000..81e7736f4 --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app162/rest/util/RestExceptionHandler.java @@ -0,0 +1,44 @@ +package test.org.springdoc.api.app162.rest.util; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import test.org.springdoc.api.app162.exception.NoResultException; +import test.org.springdoc.api.app162.exception.NonUniqueResultException; + +/** + * REST exception handlers. + * + * This javadoc description is ignored by the REST documentation. + */ +@RestControllerAdvice +public class RestExceptionHandler { + /** + * REST exception handler for {@code NoResultException}. + * + * This javadoc description is ignored by the REST documentation. + * + * @return the {@code return} javadoc for the {@code #handleNotFoundException(NoResultException)} method + */ + @ExceptionHandler(NoResultException.class) + @ResponseStatus(code = HttpStatus.NOT_FOUND) + public ResponseEntity handleNotFoundException(NoResultException exception) { + return new ResponseEntity<>("No result for the arguments.", HttpStatus.NOT_FOUND); + } + + /** + * REST exception handler for {@code NonUniqueResultException}. + * + * This javadoc description is ignored by the REST documentation. + * + * @return the {@code return} javadoc for the {@code #handleNonUniqueResultException(NonUniqueResultException)} method + */ + @ExceptionHandler(NonUniqueResultException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleNonUniqueResultException(NonUniqueResultException exception) { + return new ResponseEntity<>("No unique result found for the arguments.", HttpStatus.BAD_REQUEST); + } + +} diff --git a/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/SpringDocApp163Test.java b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/SpringDocApp163Test.java new file mode 100644 index 000000000..a15dc7d98 --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/SpringDocApp163Test.java @@ -0,0 +1,38 @@ +package test.org.springdoc.api.app163; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; +import test.org.springdoc.api.AbstractSpringDocTest; + +/** + * The type Spring doc app 163 test. + */ +@TestPropertySource(properties = "springdoc.override-with-generic-response-if-declared=true") +public class SpringDocApp163Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info() + .title("SpringShop API") + .version("v1") + .description("The description of the api")); + } + + } + + +} diff --git a/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/exception/NoResultException.java b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/exception/NoResultException.java new file mode 100644 index 000000000..b051533bc --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/exception/NoResultException.java @@ -0,0 +1,4 @@ +package test.org.springdoc.api.app163.exception; + +public class NoResultException extends RuntimeException { +} diff --git a/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/exception/NonUniqueResultException.java b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/exception/NonUniqueResultException.java new file mode 100644 index 000000000..270925402 --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/exception/NonUniqueResultException.java @@ -0,0 +1,7 @@ +package test.org.springdoc.api.app163.exception; + +/** + * Multiple results found instead of a unique result. + */ +public class NonUniqueResultException extends RuntimeException{ +} diff --git a/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/rest/AnnotationOverrideForJavadocRestController.java b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/rest/AnnotationOverrideForJavadocRestController.java new file mode 100644 index 000000000..1bac1caa1 --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/rest/AnnotationOverrideForJavadocRestController.java @@ -0,0 +1,97 @@ +package test.org.springdoc.api.app163.rest; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; +import test.org.springdoc.api.app163.exception.NoResultException; +import test.org.springdoc.api.app163.exception.NonUniqueResultException; +import test.org.springdoc.api.app163.rest.dto.AnnotationOverrideForJavadocRestDto; + +/** + * This is the {@code AnnotationOverrideForJavadocRestController} class javadoc. + */ +@Tag( + name = "annotation-override", + description = "Description for the tag." +) +@RestController +@RequestMapping("/annotation-override") +public class AnnotationOverrideForJavadocRestController { + /** + * This is the update method's javadoc. + * The method's signature: {@code #update(String, AnnotationOverrideForJavadocRestDto)} + * + * @param guid the {@code @param input} javadoc for the {@code #update(String, AnnotationOverrideForJavadocRestDto)} method + * @return the {@code @return} javadoc for the {@code #update(String, AnnotationOverrideForJavadocRestDto)} method + */ + @Operation( + summary = "Summary for #update(String, AnnotationOverrideForJavadocRestDto)" + ) + @PutMapping(path = "{guid}", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(HttpStatus.OK) + public ResponseEntity update(@PathVariable String guid, @RequestBody AnnotationOverrideForJavadocRestDto input) throws NoResultException { + return new ResponseEntity<>(HttpStatus.CREATED); + } + + /** + * This is the create method's javadoc. + * The method's signature: {@code #create(AnnotationOverrideForJavadocRestDto)} + * + * @param input the {@code @param input} javadoc for the {@code #create(AnnotationOverrideForJavadocRestDto)} method + * @return the {@code @return} javadoc for the {@code #create(AnnotationOverrideForJavadocRestDto)} method + */ + @Operation( + summary = "Summary for #create(AnnotationOverrideForJavadocRestDto)", + description = "Description for #create(AnnotationOverrideForJavadocRestDto)", + requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "Request body for #create(AnnotationOverrideForJavadocRestDto)" + ) , + responses = { + @ApiResponse( + description = "API Response 201 for #create(AnnotationOverrideForJavadocRestDto)" + ) + } + ) + @PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(HttpStatus.CREATED) + public ResponseEntity create(@RequestBody AnnotationOverrideForJavadocRestDto input) { + return new ResponseEntity<>(HttpStatus.CREATED); + } + + /** + * This is the findStartsBy method's javadoc. + * The method's signature: {@code #findStartsBy(String)} + * + * @param prefix the {@code @param prefix} javadoc for the {@code #findStartsBy(String)} method + * @return the {@code @return} javadoc for the {@code #findStartsBy(String)} method + * @throws NoResultException the {@code @throws NoResultException} javadoc for the {@code #findStartsBy(String)} method + * @throws NonUniqueResultException the {@code @throws NonUniqueResultException} javadoc for the {@code #findStartsBy(String)} method + */ + @Operation( + parameters = { + @Parameter( + name = "prefix", + description = "Parameter prefix" + ) + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "API Response 200 for #findStartsBy(prefix)" + ), + @ApiResponse( + responseCode = "400", + description = "API Response 400 for #findStartsBy(prefix)" + ) + } + ) + @GetMapping(path = "startsBy/{prefix}", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity findStartsBy(@PathVariable String prefix) throws NoResultException, NonUniqueResultException { + return new ResponseEntity<>(HttpStatus.OK); + } +} diff --git a/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto.java b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto.java new file mode 100644 index 000000000..5bb6fa354 --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto.java @@ -0,0 +1,65 @@ +package test.org.springdoc.api.app163.rest.dto; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * This is the {@code AnnotationOverrideForJavadocRestDto} class javadoc. + */ +@Schema( + title = "annotation-override-dto", + description = "Description for the tag." +) +public class AnnotationOverrideForJavadocRestDto { + /** + * This is the private {@code #guid} field's javadoc. + */ + @Schema(description = "Description for the #guid field") + private String guid; + /** + * This is the private {@code #inner} field's javadoc. + *

+ * This javadoc description is ignored by the REST documentation: + * the {@code $ref} can't have a description as any sibling elements of a $ref are ignored. + */ + private AnnotationOverrideForJavadocStaticInnerRestDto inner; + + public AnnotationOverrideForJavadocRestDto() { + } + + public String getGuid() { + return guid; + } + + public void setGuid(String guid) { + this.guid = guid; + } + + public AnnotationOverrideForJavadocStaticInnerRestDto getInner() { + return inner; + } + + public void setInner(AnnotationOverrideForJavadocStaticInnerRestDto inner) { + this.inner = inner; + } + + /** + * This is the {@code AnnotationOverrideForJavadocStaticInnerRestDto} class javadoc. + */ + public static class AnnotationOverrideForJavadocStaticInnerRestDto { + /** + * This is the private {@code #content} field's javadoc. + */ + private String content; + + public AnnotationOverrideForJavadocStaticInnerRestDto() { + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + } +} diff --git a/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto2.java b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto2.java new file mode 100644 index 000000000..0b2232821 --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto2.java @@ -0,0 +1,25 @@ +package test.org.springdoc.api.app163.rest.dto; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * This is the {@code AnnotationOverrideForJavadocRestDto2} class javadoc. + */ +public class AnnotationOverrideForJavadocRestDto2 { + /** + * This is the private {@code #guid3} field's javadoc. + */ + private String guid3; + + public AnnotationOverrideForJavadocRestDto2() { + } + + public String getGuid3() { + return guid3; + } + + public void setGuid3(String guid3) { + this.guid3 = guid3; + } + +} diff --git a/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto3.java b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto3.java new file mode 100644 index 000000000..d63305228 --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/rest/dto/AnnotationOverrideForJavadocRestDto3.java @@ -0,0 +1,23 @@ +package test.org.springdoc.api.app163.rest.dto; + +/** + * This is the {@code AnnotationOverrideForJavadocRestDto3} class javadoc. + */ +public class AnnotationOverrideForJavadocRestDto3 { + /** + * This is the private {@code #guid4} field's javadoc. + */ + private String guid4; + + public AnnotationOverrideForJavadocRestDto3() { + } + + public String getGuid4() { + return guid4; + } + + public void setGuid4(String guid4) { + this.guid4 = guid4; + } + +} diff --git a/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/rest/util/RestExceptionHandler.java b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/rest/util/RestExceptionHandler.java new file mode 100644 index 000000000..563153a3d --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app163/rest/util/RestExceptionHandler.java @@ -0,0 +1,44 @@ +package test.org.springdoc.api.app163.rest.util; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import test.org.springdoc.api.app163.exception.NoResultException; +import test.org.springdoc.api.app163.exception.NonUniqueResultException; + +/** + * REST exception handlers. + * + * This javadoc description is ignored by the REST documentation. + */ +@RestControllerAdvice +public class RestExceptionHandler { + /** + * REST exception handler for {@code NoResultException}. + * + * This javadoc description is ignored by the REST documentation. + * + * @return the {@code return} javadoc for the {@code #handleNotFoundException(NoResultException)} method + */ + @ExceptionHandler(NoResultException.class) + @ResponseStatus(code = HttpStatus.NOT_FOUND) + public ResponseEntity handleNotFoundException(NoResultException exception) { + return new ResponseEntity<>("No result for the arguments.", HttpStatus.NOT_FOUND); + } + + /** + * REST exception handler for {@code NonUniqueResultException}. + * + * This javadoc description is ignored by the REST documentation. + * + * @return the {@code return} javadoc for the {@code #handleNonUniqueResultException(NonUniqueResultException)} method + */ + @ExceptionHandler(NonUniqueResultException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleNonUniqueResultException(NonUniqueResultException exception) { + return new ResponseEntity<>("No unique result found for the arguments.", HttpStatus.BAD_REQUEST); + } + +} diff --git a/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app164/SpringDocApp164Test.java b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app164/SpringDocApp164Test.java new file mode 100644 index 000000000..f8de024ac --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app164/SpringDocApp164Test.java @@ -0,0 +1,37 @@ +package test.org.springdoc.api.app164; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.TestPropertySource; +import test.org.springdoc.api.AbstractSpringDocTest; + +/** + * The type Spring doc app 164 test. + */ +public class SpringDocApp164Test extends AbstractSpringDocTest { + + /** + * The type Spring doc test app. + */ + @SpringBootApplication + static class SpringDocTestApp { + /** + * Custom open api open api. + * + * @return the open api + */ + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info() + .title("SpringShop API") + .version("v1") + .description("The description of the api")); + } + + } + + +} diff --git a/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app164/exception/NoResultException.java b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app164/exception/NoResultException.java new file mode 100644 index 000000000..ced3e68df --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app164/exception/NoResultException.java @@ -0,0 +1,4 @@ +package test.org.springdoc.api.app164.exception; + +public class NoResultException extends RuntimeException { +} diff --git a/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app164/exception/NonUniqueResultException.java b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app164/exception/NonUniqueResultException.java new file mode 100644 index 000000000..83d9836a1 --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app164/exception/NonUniqueResultException.java @@ -0,0 +1,7 @@ +package test.org.springdoc.api.app164.exception; + +/** + * Multiple results found instead of a unique result. + */ +public class NonUniqueResultException extends RuntimeException{ +} diff --git a/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app164/rest/NoGenericOverrideRestController.java b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app164/rest/NoGenericOverrideRestController.java new file mode 100644 index 000000000..e22fb66bb --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app164/rest/NoGenericOverrideRestController.java @@ -0,0 +1,42 @@ +package test.org.springdoc.api.app164.rest; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; +import test.org.springdoc.api.app164.exception.NoResultException; +import test.org.springdoc.api.app164.exception.NonUniqueResultException; + +/** + * This is the {@code JavadocOnlyRestController} class javadoc. + */ +@RestController +@RequestMapping("/no-generic-override") +public class NoGenericOverrideRestController { + /** + * This is the create method's javadoc. + * The method's signature: {@code #create(JavadocOnlyRestDto)} + * + * @param input the {@code @param input} javadoc for the {@code #create(JavadocOnlyRestDto)} method + * @return the {@code @return} javadoc for the {@code #create(JavadocOnlyRestDto)} method + */ + @PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(HttpStatus.CREATED) + public ResponseEntity create(@RequestBody String input) { + return new ResponseEntity<>(HttpStatus.CREATED); + } + + /** + * This is the findStartsBy method's javadoc. + * The method's signature: {@code #findStartsBy(String)} + * + * @param prefix the {@code @param prefix} javadoc for the {@code #findStartsBy(String)} method + * @return the {@code @return} javadoc for the {@code #findStartsBy(String)} method + * @throws NoResultException the {@code @throws NoResultException} javadoc for the {@code #findStartsBy(String)} method + * @throws NonUniqueResultException the {@code @throws NonUniqueResultException} javadoc for the {@code #findStartsBy(String)} method + */ + @GetMapping(path = "startsBy/{prefix}", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity findStartsBy(@PathVariable String prefix) throws NoResultException, NonUniqueResultException { + return new ResponseEntity<>(HttpStatus.OK); + } +} diff --git a/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app164/rest/util/RestExceptionHandler.java b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app164/rest/util/RestExceptionHandler.java new file mode 100644 index 000000000..a6800f4e5 --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app164/rest/util/RestExceptionHandler.java @@ -0,0 +1,44 @@ +package test.org.springdoc.api.app164.rest.util; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import test.org.springdoc.api.app164.exception.NoResultException; +import test.org.springdoc.api.app164.exception.NonUniqueResultException; + +/** + * REST exception handlers. + * + * This javadoc description is ignored by the REST documentation. + */ +@RestControllerAdvice +public class RestExceptionHandler { + /** + * REST exception handler for {@code NoResultException}. + * + * This javadoc description is ignored by the REST documentation. + * + * @return the {@code return} javadoc for the {@code #handleNotFoundException(NoResultException)} method + */ + @ExceptionHandler(NoResultException.class) + @ResponseStatus(code = HttpStatus.NOT_FOUND) + public ResponseEntity handleNotFoundException(NoResultException exception) { + return new ResponseEntity<>("No result for the arguments.", HttpStatus.NOT_FOUND); + } + + /** + * REST exception handler for {@code NonUniqueResultException}. + * + * This javadoc description is ignored by the REST documentation. + * + * @return the {@code return} javadoc for the {@code #handleNonUniqueResultException(NonUniqueResultException)} method + */ + @ExceptionHandler(NonUniqueResultException.class) + @ResponseStatus(code = HttpStatus.BAD_REQUEST) + public ResponseEntity handleNonUniqueResultException(NonUniqueResultException exception) { + return new ResponseEntity<>("No unique result found for the arguments.", HttpStatus.BAD_REQUEST); + } + +} diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app1.json b/springdoc-openapi-javadoc/src/test/resources/results/app1.json index d38778126..edd30bd16 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app1.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app1.json @@ -212,6 +212,7 @@ "tags": [ "items" ], + "summary": "Show items list.", "description": "Show items list.", "operationId": "showItems", "parameters": [ @@ -293,6 +294,7 @@ "tags": [ "items" ], + "summary": "Add item response entity.", "description": "Add item response entity.", "operationId": "addItem", "requestBody": { @@ -494,6 +496,7 @@ "tags": [ "tea" ], + "summary": "Index string.", "description": "Index string.", "operationId": "index", "parameters": [ @@ -554,7 +557,8 @@ "type": "string", "description": "The Message." } - } + }, + "description": "The type Error message." }, "PersonDTO": { "type": "object", @@ -571,7 +575,8 @@ "type": "string", "description": "The Last name." } - } + }, + "description": "The type Person dto." }, "ItemLightDTO": { "type": "object", @@ -591,7 +596,8 @@ "format": "int32", "deprecated": true } - } + }, + "description": "The type Item light dto." }, "InventoryItem": { "required": [ @@ -621,7 +627,8 @@ "manufacturer": { "$ref": "#/components/schemas/Manufacturer" } - } + }, + "description": "InventoryItem" }, "Manufacturer": { "required": [ @@ -644,7 +651,8 @@ "description": "The Phone.", "example": "408-867-5309" } - } + }, + "description": "Manufacturer" }, "ItemDTO": { "type": "object", @@ -668,7 +676,8 @@ "format": "int32", "deprecated": true } - } + }, + "description": "The type Item dto." } }, "securitySchemes": { @@ -678,4 +687,4 @@ } } } -} +} \ No newline at end of file diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app10.json b/springdoc-openapi-javadoc/src/test/resources/results/app10.json index f9de7c7b3..57c28a4a2 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app10.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app10.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/testreq": { "get": { "tags": [ "hello-controller" ], + "summary": "Test request attribute.", "description": "Test request attribute.", "operationId": "testRequestAttribute", "parameters": [ @@ -41,6 +48,7 @@ "tags": [ "hello-controller" ], + "summary": "Test.", "description": "Test.", "operationId": "test", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app100.json b/springdoc-openapi-javadoc/src/test/resources/results/app100.json index a6e16a07e..35a975df2 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app100.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app100.json @@ -25,6 +25,7 @@ "hello-ap1", "hello-ap2" ], + "summary": "Gets all pets.", "description": "Gets all pets.", "operationId": "getAllPets", "parameters": [ @@ -75,8 +76,9 @@ "type": "string", "description": "The Last name." } - } + }, + "description": "The type Person dto." } } } -} +} \ No newline at end of file diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app101.json b/springdoc-openapi-javadoc/src/test/resources/results/app101.json index 678558436..c7636868a 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app101.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app101.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/hello": { "get": { "tags": [ "hello-controller" ], + "summary": "Hello hello dto.", "description": "Hello hello dto.", "operationId": "hello", "responses": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app102.json b/springdoc-openapi-javadoc/src/test/resources/results/app102.json index f904351fa..7dbbdae94 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app102.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app102.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "test-controller", + "description": "The type Test controller." + } + ], "paths": { "/test": { "get": { "tags": [ "test-controller" ], + "summary": "Gets test.", "description": "Gets test.", "operationId": "getTest", "parameters": [ @@ -145,7 +152,8 @@ "type": "integer", "description": "The Param 2." } - } + }, + "description": "The type Nested." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app103.json b/springdoc-openapi-javadoc/src/test/resources/results/app103.json index b96a273ed..d8b78ff21 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app103.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app103.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/test/103": { "post": { "tags": [ "hello-controller" ], + "summary": "Post my request body string.", "description": "Post my request body string.", "operationId": "postMyRequestBody", "requestBody": { @@ -75,7 +82,8 @@ "description": "The Int param.", "format": "int32" } - } + }, + "description": "The type Example body." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app105-1.json b/springdoc-openapi-javadoc/src/test/resources/results/app105-1.json index edb8c1e2e..1dd42962b 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app105-1.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app105-1.json @@ -257,7 +257,8 @@ "type": "string", "description": "Order Status" } - } + }, + "description": "The type Order." } }, "securitySchemes": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app105-2.json b/springdoc-openapi-javadoc/src/test/resources/results/app105-2.json index 7fec67a48..2d477a7f2 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app105-2.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app105-2.json @@ -425,7 +425,8 @@ "type": "string", "description": "The Username." } - } + }, + "description": "The type User." } }, "securitySchemes": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app105-3.json b/springdoc-openapi-javadoc/src/test/resources/results/app105-3.json index 6dce26cd6..af369b7c5 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app105-3.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app105-3.json @@ -570,7 +570,8 @@ "type": "string", "description": "The Type." } - } + }, + "description": "The type Model api response." }, "Pet": { "required": [ @@ -615,7 +616,8 @@ "$ref": "#/components/schemas/Tag" } } - } + }, + "description": "The type Pet." }, "Tag": { "type": "object", diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app105-4.json b/springdoc-openapi-javadoc/src/test/resources/results/app105-4.json index 2552cc971..bb0a3df90 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app105-4.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app105-4.json @@ -28,6 +28,7 @@ "tags": [ "store" ], + "summary": "Stores.", "description": "Stores.", "operationId": "stores", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app106.json b/springdoc-openapi-javadoc/src/test/resources/results/app106.json index 5cd87acf0..88bea26f0 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app106.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app106.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/": { "get": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app107.json b/springdoc-openapi-javadoc/src/test/resources/results/app107.json index 7d72d81b0..8a6a1b54b 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app107.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app107.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/entity-b": { "get": { "tags": [ "hello-controller" ], + "summary": "Gets entity b.", "description": "Gets entity b.", "operationId": "getEntityB", "responses": { @@ -50,7 +57,8 @@ "type": "string", "description": "The Field a." } - } + }, + "description": "The type Entity a." }, "EntityB": { "required": [ @@ -66,7 +74,8 @@ "entityA": { "$ref": "#/components/schemas/EntityA" } - } + }, + "description": "The type Entity b." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app108.json b/springdoc-openapi-javadoc/src/test/resources/results/app108.json index 13a58e5d1..76477a2aa 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app108.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app108.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/": { "post": { "tags": [ "hello-controller" ], + "summary": "Update action result.", "description": "Update action result.", "operationId": "update", "parameters": [ @@ -73,8 +80,9 @@ "type": "object", "description": "The Value." } - } + }, + "description": "The type Action result." } } } -} +} \ No newline at end of file diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app109.json b/springdoc-openapi-javadoc/src/test/resources/results/app109.json index 3ce50cd42..48bd63c93 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app109.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app109.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/api/v1/resource": { "get": { "tags": [ "hello-controller" ], + "summary": "Gets resource.", "description": "Gets resource.", "operationId": "getResource", "responses": { @@ -38,6 +45,7 @@ "tags": [ "hello-controller" ], + "summary": "Get byte array byte [ ].", "description": "Get byte array byte [ ].", "operationId": "getByteArray", "responses": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app11.json b/springdoc-openapi-javadoc/src/test/resources/results/app11.json index b956691f6..9f60a4b4b 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app11.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app11.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/documents": { "post": { "tags": [ "hello-controller" ], + "summary": "Upload documents response entity.", "description": "Upload documents response entity.", "operationId": "uploadDocuments", "requestBody": { @@ -59,6 +66,7 @@ "tags": [ "hello-controller" ], + "summary": "Post track string.", "description": "Post track string.", "operationId": "postTrack", "requestBody": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app110.json b/springdoc-openapi-javadoc/src/test/resources/results/app110.json index b18a01225..18cacc1db 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app110.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app110.json @@ -16,12 +16,23 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "person-controller", + "description": "The type Person controller." + }, + { + "name": "person-controller-2", + "description": "The type Person controller 2." + } + ], "paths": { "/person": { "post": { "tags": [ "person-controller" ], + "summary": "Person person.", "description": "Person person.", "operationId": "person", "requestBody": { @@ -36,12 +47,12 @@ "required": true }, "responses": { - "415": { + "500": { "description": "the response entity", "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/ErrorMessage" + "$ref": "#/components/schemas/Problem" } } } @@ -56,12 +67,12 @@ } } }, - "500": { + "415": { "description": "the response entity", "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/Problem" + "$ref": "#/components/schemas/ErrorMessage" } } } @@ -84,6 +95,7 @@ "tags": [ "person-controller-2" ], + "summary": "Person person.", "description": "Person person.", "operationId": "person_1", "requestBody": { @@ -116,6 +128,7 @@ "tags": [ "person-controller" ], + "summary": "Find by last name list.", "description": "Find by last name list.", "operationId": "findByLastName", "parameters": [ @@ -132,12 +145,12 @@ } ], "responses": { - "415": { + "500": { "description": "the response entity", "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/ErrorMessage" + "$ref": "#/components/schemas/Problem" } } } @@ -152,12 +165,12 @@ } } }, - "500": { + "415": { "description": "the response entity", "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/Problem" + "$ref": "#/components/schemas/ErrorMessage" } } } @@ -183,6 +196,7 @@ "tags": [ "person-controller-2" ], + "summary": "Find by last name list.", "description": "Find by last name list.", "operationId": "findByLastName_1", "parameters": [ @@ -218,18 +232,6 @@ }, "components": { "schemas": { - "ErrorMessage": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "description": "The Errors.", - "items": { - "type": "string" - } - } - } - }, "Problem": { "type": "object", "properties": { @@ -241,7 +243,21 @@ "type": "string", "description": "The Message." } - } + }, + "description": "The type Problem." + }, + "ErrorMessage": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "description": "The Errors.", + "items": { + "type": "string" + } + } + }, + "description": "The type Error message." }, "Person": { "required": [ @@ -286,7 +302,8 @@ "type": "string", "description": "The Credit card number." } - } + }, + "description": "The type Person." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app111.json b/springdoc-openapi-javadoc/src/test/resources/results/app111.json index 0c87f099c..853585c74 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app111.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app111.json @@ -16,12 +16,23 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "person-controller", + "description": "The type Person controller." + }, + { + "name": "person-controller-2", + "description": "The type Person controller 2." + } + ], "paths": { "/person": { "post": { "tags": [ "person-controller" ], + "summary": "Person person.", "description": "Person person.", "operationId": "person", "requestBody": { @@ -54,6 +65,7 @@ "tags": [ "person-controller-2" ], + "summary": "Person person.", "description": "Person person.", "operationId": "person_1", "requestBody": { @@ -86,6 +98,7 @@ "tags": [ "person-controller" ], + "summary": "Find by last name list.", "description": "Find by last name list.", "operationId": "findByLastName", "parameters": [ @@ -123,6 +136,7 @@ "tags": [ "person-controller-2" ], + "summary": "Find by last name list.", "description": "Find by last name list.", "operationId": "findByLastName_1", "parameters": [ @@ -201,7 +215,8 @@ "type": "string", "description": "The Credit card number." } - } + }, + "description": "The type Person." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app112.json b/springdoc-openapi-javadoc/src/test/resources/results/app112.json index 65831042d..06e588d36 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app112.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app112.json @@ -16,12 +16,23 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "person-controller", + "description": "The type Person controller." + }, + { + "name": "person-controller-2", + "description": "The type Person controller 2." + } + ], "paths": { "/person": { "post": { "tags": [ "person-controller" ], + "summary": "Person person.", "description": "Person person.", "operationId": "person", "requestBody": { @@ -54,6 +65,7 @@ "tags": [ "person-controller-2" ], + "summary": "Person person.", "description": "Person person.", "operationId": "person_1", "requestBody": { @@ -68,12 +80,12 @@ "required": true }, "responses": { - "415": { + "500": { "description": "the response entity", "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/ErrorMessage" + "$ref": "#/components/schemas/Problem" } } } @@ -88,12 +100,12 @@ } } }, - "500": { + "415": { "description": "the response entity", "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/Problem" + "$ref": "#/components/schemas/ErrorMessage" } } } @@ -116,6 +128,7 @@ "tags": [ "person-controller" ], + "summary": "Find by last name list.", "description": "Find by last name list.", "operationId": "findByLastName", "parameters": [ @@ -153,6 +166,7 @@ "tags": [ "person-controller-2" ], + "summary": "Find by last name list.", "description": "Find by last name list.", "operationId": "findByLastName_1", "parameters": [ @@ -169,12 +183,12 @@ } ], "responses": { - "415": { + "500": { "description": "the response entity", "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/ErrorMessage" + "$ref": "#/components/schemas/Problem" } } } @@ -189,12 +203,12 @@ } } }, - "500": { + "415": { "description": "the response entity", "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/Problem" + "$ref": "#/components/schemas/ErrorMessage" } } } @@ -218,18 +232,6 @@ }, "components": { "schemas": { - "ErrorMessage": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "description": "The Errors.", - "items": { - "type": "string" - } - } - } - }, "Problem": { "type": "object", "properties": { @@ -241,7 +243,21 @@ "type": "string", "description": "The Message." } - } + }, + "description": "The type Problem." + }, + "ErrorMessage": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "description": "The Errors.", + "items": { + "type": "string" + } + } + }, + "description": "The type Error message." }, "Person": { "required": [ @@ -286,7 +302,8 @@ "type": "string", "description": "The Credit card number." } - } + }, + "description": "The type Person." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app113.json b/springdoc-openapi-javadoc/src/test/resources/results/app113.json index 0dca80c71..cb491d11d 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app113.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app113.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/lol": { "post": { "tags": [ "hello-controller" ], + "summary": "Test.", "description": "Test.", "operationId": "test", "requestBody": { @@ -40,6 +47,7 @@ "tags": [ "hello-controller" ], + "summary": "Test 2.", "description": "Test 2.", "operationId": "test2", "requestBody": { @@ -69,7 +77,8 @@ "type": "string", "description": "The Field." } - } + }, + "description": "The type Body." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app114.json b/springdoc-openapi-javadoc/src/test/resources/results/app114.json index cd00467cb..51a4d927f 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app114.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app114.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/foos1": { "post": { "tags": [ "hello-controller" ], + "summary": "Gets currency.", "description": "Gets currency.", "operationId": "getCurrency", "requestBody": { @@ -52,7 +59,8 @@ "price": { "$ref": "#/components/schemas/MonetaryAmount" } - } + }, + "description": "The type Car dto." }, "MonetaryAmount": { "type": "object", diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app115.json b/springdoc-openapi-javadoc/src/test/resources/results/app115.json index e2210e014..174ff999c 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app115.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app115.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/api/v2/timeout": { "get": { "tags": [ "hello-controller" ], + "summary": "Timeouts duration.", "description": "Timeouts duration.", "operationId": "timeouts", "responses": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app116.json b/springdoc-openapi-javadoc/src/test/resources/results/app116.json index c7ee9d175..605bc90f0 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app116.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app116.json @@ -13,6 +13,10 @@ "tags": [ { "name": "Operations" + }, + { + "name": "hello-controller", + "description": "The type Hello controller." } ], "paths": { @@ -21,6 +25,7 @@ "tags": [ "hello-controller" ], + "summary": "Create string.", "description": "Create string.", "operationId": "create", "requestBody": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app117.json b/springdoc-openapi-javadoc/src/test/resources/results/app117.json index 3ccb65c27..41a79d880 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app117.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app117.json @@ -10,12 +10,23 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "greetings-rest-controller", + "description": "The type Greetings rest controller." + }, + { + "name": "person-service", + "description": "The type Person service." + } + ], "paths": { "/greet/{name}": { "get": { "tags": [ "greetings-rest-controller" ], + "summary": "Greet string.", "description": "Greet string.", "operationId": "greet", "parameters": [ @@ -48,6 +59,7 @@ "tags": [ "person-service" ], + "summary": "All set.", "description": "All set.", "operationId": "all", "responses": { @@ -71,6 +83,7 @@ "tags": [ "person-service" ], + "summary": "Save person.", "description": "Save person.", "operationId": "save", "parameters": [ @@ -103,6 +116,7 @@ "tags": [ "person-service" ], + "summary": "By id person.", "description": "By id person.", "operationId": "byId", "parameters": [ @@ -146,8 +160,9 @@ "type": "string", "description": "The Name." } - } + }, + "description": "The type Person." } } } -} +} \ No newline at end of file diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app118.json b/springdoc-openapi-javadoc/src/test/resources/results/app118.json index b9d4693a5..7e9c83e20 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app118.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app118.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "controller", + "description": "The type Controller." + } + ], "paths": { "/class-hierarchy/abstract-parent": { "post": { "tags": [ "controller" ], + "summary": "Abstract parent response.", "description": "Abstract parent response.", "operationId": "abstractParent", "requestBody": { @@ -55,6 +62,7 @@ "tags": [ "controller" ], + "summary": "Concrete parent response.", "description": "Concrete parent response.", "operationId": "concreteParent", "requestBody": { @@ -115,6 +123,7 @@ }, "ChildOfAbstract1": { "type": "object", + "description": "The type Child of abstract 1.", "allOf": [ { "$ref": "#/components/schemas/AbstractParent" @@ -137,6 +146,7 @@ }, "ChildOfAbstract2": { "type": "object", + "description": "The type Child of abstract 2.", "allOf": [ { "$ref": "#/components/schemas/AbstractParent" @@ -159,6 +169,7 @@ }, "ChildOfConcrete1": { "type": "object", + "description": "The type Child of concrete 1.", "allOf": [ { "$ref": "#/components/schemas/ConcreteParent" @@ -181,6 +192,7 @@ }, "ChildOfConcrete2": { "type": "object", + "description": "The type Child of concrete 2.", "allOf": [ { "$ref": "#/components/schemas/ConcreteParent" @@ -216,6 +228,7 @@ "type": "string" } }, + "description": "The type Concrete parent.", "discriminator": { "propertyName": "type" } @@ -251,7 +264,8 @@ ] } } - } + }, + "description": "The type Response." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app119.json b/springdoc-openapi-javadoc/src/test/resources/results/app119.json index 5eda28132..aa448ce67 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app119.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app119.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/multi": { "post": { @@ -29,9 +35,6 @@ ], "type": "object", "properties": { - "params": { - "$ref": "#/components/schemas/JsonRequest" - }, "file1": { "type": "string", "description": "This is file1", @@ -41,6 +44,9 @@ "type": "string", "description": "This is file2", "format": "binary" + }, + "params": { + "$ref": "#/components/schemas/JsonRequest" } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app12.json b/springdoc-openapi-javadoc/src/test/resources/results/app12.json index d4cf5c463..38bad76d5 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app12.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app12.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/persons": { "get": { "tags": [ "hello-controller" ], + "summary": "Persons string.", "description": "Persons string.", "operationId": "persons", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app120.json b/springdoc-openapi-javadoc/src/test/resources/results/app120.json index 5c2ad258f..726523a24 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app120.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app120.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "meta-annotation-controller", + "description": "The type Meta annotation controller." + } + ], "paths": { "/testTopLevelParamAnnotationOverrides/{accountId}": { "get": { "tags": [ "meta-annotation-controller" ], + "summary": "When there is a top level @Parameter annotation it has precedence over the meta-annotation\n So the id parameter should have all the defaults, with a name of \"id\"", "description": "When there is a top level @Parameter annotation it has precedence over the meta-annotation\n So the id parameter should have all the defaults, with a name of \"id\"", "operationId": "testTopLevelParamAnnotationOverrides", "parameters": [ @@ -48,6 +55,7 @@ "tags": [ "meta-annotation-controller" ], + "summary": "Test query param string.", "description": "Test query param string.", "operationId": "testQueryParam", "parameters": [ @@ -81,6 +89,7 @@ "tags": [ "meta-annotation-controller" ], + "summary": "Test no alias fors string.", "description": "Test no alias fors string.", "operationId": "testNoAliasFors", "parameters": [ @@ -119,6 +128,7 @@ "tags": [ "meta-annotation-controller" ], + "summary": "Test meta meta annotation string.", "description": "Test meta meta annotation string.", "operationId": "testMetaMetaAnnotation", "parameters": [ @@ -162,6 +172,7 @@ "tags": [ "meta-annotation-controller" ], + "summary": "Test all attributes as alias string.", "description": "Test all attributes as alias string.", "operationId": "testAllAttributesAsAlias", "parameters": [ @@ -200,6 +211,7 @@ "tags": [ "meta-annotation-controller" ], + "summary": "@AliasFor in the @AccountId annotation allows us to override the default it provides.", "description": "@AliasFor in the @AccountId annotation allows us to override the default it provides.", "operationId": "testAliasFor", "parameters": [ @@ -233,6 +245,7 @@ "tags": [ "meta-annotation-controller" ], + "summary": "Simple test string.", "description": "Simple test string.", "operationId": "simpleTest", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app121.json b/springdoc-openapi-javadoc/src/test/resources/results/app121.json index 4c7c6c8e9..5af5df52e 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app121.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app121.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "test-controller", + "description": "The type Test controller." + } + ], "paths": { "/test": { "post": { "tags": [ "test-controller" ], + "summary": "Gets test.", "description": "Gets test.", "operationId": "getTest", "parameters": [ @@ -152,7 +159,8 @@ "type": "integer", "description": "The Param 2." } - } + }, + "description": "The type Nested." }, "InheritedRequestParams": { "required": [ @@ -200,7 +208,8 @@ "type": "string", "description": "parameter from child of RequestParams" } - } + }, + "description": "The type Inherited request params." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app122.json b/springdoc-openapi-javadoc/src/test/resources/results/app122.json index d189cfba3..fab054463 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app122.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app122.json @@ -63,7 +63,8 @@ "type": "string", "description": "The Customer name." } - } + }, + "description": "The type Customer dto." }, "WrapperCustomerDto": { "type": "object", @@ -72,8 +73,9 @@ "type": "string", "description": "The Wrapper." } - } + }, + "description": "The type Wrapper." } } } -} +} \ No newline at end of file diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app123.json b/springdoc-openapi-javadoc/src/test/resources/results/app123.json index d3c081cd7..ee8242461 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app123.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app123.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/hello/{numTelco}": { "get": { @@ -40,6 +46,9 @@ } ], "responses": { + "404": { + "description": "Not here" + }, "502": { "description": "the object", "content": { @@ -50,9 +59,6 @@ } } }, - "404": { - "description": "Not here" - }, "418": { "description": "the t", "content": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app124.json b/springdoc-openapi-javadoc/src/test/resources/results/app124.json index d3c081cd7..9ba464e1f 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app124.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app124.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/hello/{numTelco}": { "get": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app125.json b/springdoc-openapi-javadoc/src/test/resources/results/app125.json index 6a001c30d..76a726295 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app125.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app125.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/search": { "get": { "tags": [ "hello-controller" ], + "summary": "Gets all pets.", "description": "Gets all pets.", "operationId": "getAllPets", "parameters": [ @@ -63,7 +70,8 @@ "description": "The Mydeprecated field.", "deprecated": true } - } + }, + "description": "The type Deprecated entity." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app126.json b/springdoc-openapi-javadoc/src/test/resources/results/app126.json index 3b74c8398..6827b7338 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app126.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app126.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/": { "get": { @@ -66,13 +72,14 @@ "type": "integer", "format": "int32" }, - "detail": { + "title": { "type": "string" }, - "title": { + "detail": { "type": "string" } - } + }, + "description": "The interface Problem." } }, "responses": { @@ -108,4 +115,4 @@ } } } -} +} \ No newline at end of file diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app129.json b/springdoc-openapi-javadoc/src/test/resources/results/app129.json index 389eeef47..2c953c197 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app129.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app129.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/api/test": { "post": { "tags": [ "hello-controller" ], + "summary": "Update deferred result.", "description": "Update deferred result.", "operationId": "update", "parameters": [ @@ -69,7 +76,8 @@ "type": "string", "description": "The Result." } - } + }, + "description": "The type Actual returned entity." }, "OperationResponseActualReturnedEntity": { "type": "object", @@ -78,7 +86,8 @@ "type": "string", "description": "The Operation result." } - } + }, + "description": "The type Operation response." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app13.json b/springdoc-openapi-javadoc/src/test/resources/results/app13.json index d3b683efe..700ae3248 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app13.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app13.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/persons": { "get": { "tags": [ "hello-controller" ], + "summary": "Persons string.", "description": "Persons string.", "operationId": "persons", "parameters": [ @@ -61,7 +68,8 @@ "type": "string", "description": "The Last name." } - } + }, + "description": "The type Person dto." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app130.json b/springdoc-openapi-javadoc/src/test/resources/results/app130.json index 0cfd53866..41f5c8a82 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app130.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app130.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/values/data": { "post": { "tags": [ "hello-controller" ], + "summary": "List tracker data.", "description": "List tracker data.", "operationId": "list", "responses": { @@ -31,6 +38,7 @@ "tags": [ "hello-controller" ], + "summary": "Get tracker data.", "description": "Get tracker data.", "operationId": "get", "responses": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app131.json b/springdoc-openapi-javadoc/src/test/resources/results/app131.json index 8f843c6ec..cebae4e1f 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app131.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app131.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/organizations": { "post": { @@ -51,9 +57,6 @@ } } }, - "204": { - "description": "The organization was created successfully" - }, "409": { "description": "An organization with the specified ID already exists", "content": { @@ -63,6 +66,9 @@ } } } + }, + "204": { + "description": "The organization was created successfully" } } } @@ -100,7 +106,8 @@ "type": "string", "description": "The Message." } - } + }, + "description": "The type Rest controller error." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app132.json b/springdoc-openapi-javadoc/src/test/resources/results/app132.json index 1bdec56a6..abbb27c23 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app132.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app132.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/organizations": { "post": { @@ -31,8 +37,8 @@ "required": true }, "responses": { - "409": { - "description": "An organization with the specified ID already exists", + "400": { + "description": "Invalid argument", "content": { "application/json": { "schema": { @@ -41,8 +47,8 @@ } } }, - "500": { - "description": "An error has occurred and the request could not be processed at this time", + "409": { + "description": "An organization with the specified ID already exists", "content": { "application/json": { "schema": { @@ -54,8 +60,8 @@ "204": { "description": "The organization was created successfully" }, - "400": { - "description": "Invalid argument", + "500": { + "description": "An error has occurred and the request could not be processed at this time", "content": { "application/json": { "schema": { @@ -100,8 +106,9 @@ "type": "string", "description": "The Message." } - } + }, + "description": "The type Rest controller error." } } } -} +} \ No newline at end of file diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app133.json b/springdoc-openapi-javadoc/src/test/resources/results/app133.json index 9fffa1a3f..86dd7a0d6 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app133.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app133.json @@ -10,14 +10,21 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { - "/test3": { + "/test1": { "get": { "tags": [ "hello-controller" ], - "description": "Gets message from header 3.", - "operationId": "getMessageFromHeader3", + "summary": "Gets message from header 1.", + "description": "Gets message from header 1.", + "operationId": "getMessageFromHeader1", "parameters": [ { "name": "myHeader", @@ -25,13 +32,17 @@ "description": "A header", "required": true, "schema": { - "type": "integer" + "type": "string", + "enum": [ + "foo", + "bar" + ] } } ], "responses": { "200": { - "description": "the message from header 3", + "description": "the message from header 1", "content": { "*/*": { "schema": { @@ -48,6 +59,7 @@ "tags": [ "hello-controller" ], + "summary": "Gets message from header 2.", "description": "Gets message from header 2.", "operationId": "getMessageFromHeader2", "parameters": [ @@ -75,13 +87,14 @@ } } }, - "/test1": { + "/test3": { "get": { "tags": [ "hello-controller" ], - "description": "Gets message from header 1.", - "operationId": "getMessageFromHeader1", + "summary": "Gets message from header 3.", + "description": "Gets message from header 3.", + "operationId": "getMessageFromHeader3", "parameters": [ { "name": "myHeader", @@ -89,17 +102,13 @@ "description": "A header", "required": true, "schema": { - "type": "string", - "enum": [ - "foo", - "bar" - ] + "type": "integer" } } ], "responses": { "200": { - "description": "the message from header 1", + "description": "the message from header 3", "content": { "*/*": { "schema": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app134-1.json b/springdoc-openapi-javadoc/src/test/resources/results/app134-1.json index 6abdb2781..5a87a3706 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app134-1.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app134-1.json @@ -69,7 +69,8 @@ "type": "string", "description": "The Id." } - } + }, + "description": "The type Sample v 1." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app134-2.json b/springdoc-openapi-javadoc/src/test/resources/results/app134-2.json index 9a36f4bf4..0f731ad6e 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app134-2.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app134-2.json @@ -115,7 +115,8 @@ "description": "The Id.", "format": "int64" } - } + }, + "description": "The type Sample search request." }, "SampleV2": { "type": "object", @@ -125,7 +126,8 @@ "description": "The Id.", "format": "int64" } - } + }, + "description": "The type Sample v 2." }, "SampleV1": { "type": "object", @@ -134,7 +136,8 @@ "type": "string", "description": "The Id." } - } + }, + "description": "The type Sample v 1." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app134-3.json b/springdoc-openapi-javadoc/src/test/resources/results/app134-3.json index 6abdb2781..5a87a3706 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app134-3.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app134-3.json @@ -69,7 +69,8 @@ "type": "string", "description": "The Id." } - } + }, + "description": "The type Sample v 1." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app134-4.json b/springdoc-openapi-javadoc/src/test/resources/results/app134-4.json index 5159a6831..f7f2dad73 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app134-4.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app134-4.json @@ -79,7 +79,8 @@ "type": "string", "description": "The Id." } - } + }, + "description": "The type Sample v 1." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app134-5.json b/springdoc-openapi-javadoc/src/test/resources/results/app134-5.json index c074b19c0..61c69fd56 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app134-5.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app134-5.json @@ -62,7 +62,8 @@ "description": "The Id.", "format": "int64" } - } + }, + "description": "The type Sample search request." }, "SampleV2": { "type": "object", @@ -72,7 +73,8 @@ "description": "The Id.", "format": "int64" } - } + }, + "description": "The type Sample v 2." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app135.json b/springdoc-openapi-javadoc/src/test/resources/results/app135.json index fd7fc52e6..64630fa3d 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app135.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app135.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "book-repository", + "description": "The type Book repository." + } + ], "paths": { "/books": { "get": { "tags": [ "book-repository" ], + "summary": "Find all list.", "description": "Find all list.", "operationId": "findAll", "responses": { @@ -48,6 +55,7 @@ "tags": [ "book-repository" ], + "summary": "Find by author list.", "description": "Find by author list.", "operationId": "findByAuthor", "parameters": [ @@ -91,6 +99,7 @@ "tags": [ "book-repository" ], + "summary": "Find all list.", "description": "Find all list.", "operationId": "findAll_1_3", "responses": { @@ -131,6 +140,7 @@ "tags": [ "book-repository" ], + "summary": "Find by author list.", "description": "Find by author list.", "operationId": "findByAuthor_3", "parameters": [ @@ -166,6 +176,7 @@ "tags": [ "book-repository" ], + "summary": "Find all list.", "description": "Find all list.", "operationId": "findAll_1_1", "responses": { @@ -206,6 +217,7 @@ "tags": [ "book-repository" ], + "summary": "Find by author list.", "description": "Find by author list.", "operationId": "findByAuthor_1", "parameters": [ @@ -241,6 +253,7 @@ "tags": [ "book-repository" ], + "summary": "Find all list.", "description": "Find all list.", "operationId": "findAll_1_4", "responses": { @@ -281,6 +294,7 @@ "tags": [ "book-repository" ], + "summary": "Find by author list.", "description": "Find by author list.", "operationId": "findByAuthor_4", "parameters": [ @@ -316,6 +330,7 @@ "tags": [ "book-repository" ], + "summary": "Find all list.", "description": "Find all list.", "operationId": "findAll_1_2", "responses": { @@ -356,6 +371,7 @@ "tags": [ "book-repository" ], + "summary": "Find by author list.", "description": "Find by author list.", "operationId": "findByAuthor_2", "parameters": [ @@ -404,7 +420,8 @@ "type": "string", "description": "The Title." } - } + }, + "description": "The type Book." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app137.json b/springdoc-openapi-javadoc/src/test/resources/results/app137.json index 217b9d08e..6540c4f6b 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app137.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app137.json @@ -11,12 +11,19 @@ "description": "toto desc" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/test": { "get": { "tags": [ "hello-controller" ], + "summary": "Test.", "description": "Test.", "operationId": "test", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app138.json b/springdoc-openapi-javadoc/src/test/resources/results/app138.json index c8ec061d1..f0ea3fb8b 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app138.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app138.json @@ -1 +1,74 @@ -{"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"description":"Generated server url","url":"http://localhost"}],"paths":{"/testA":{"get":{"description":"Test a.","operationId":"testA","parameters":[{"description":"the hello","in":"query","name":"hello","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}},"tags":["hello-controller"]}},"/testB":{"get":{"description":"Test b.","operationId":"testB","parameters":[{"description":"the hello","in":"query","name":"hello","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}},"tags":["hello-controller"]}}},"components":{}} \ No newline at end of file +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], + "paths": { + "/testA": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Test a.", + "description": "Test a.", + "operationId": "testA", + "parameters": [ + { + "name": "hello", + "in": "query", + "description": "the hello", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/testB": { + "get": { + "tags": [ + "hello-controller" + ], + "summary": "Test b.", + "description": "Test b.", + "operationId": "testB", + "parameters": [ + { + "name": "hello", + "in": "query", + "description": "the hello", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app139.json b/springdoc-openapi-javadoc/src/test/resources/results/app139.json index 3947c4488..e0031c388 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app139.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app139.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/test1": { "get": { "tags": [ "hello-controller" ], + "summary": "Echo 1 string.", "description": "Echo 1 string.", "operationId": "echo1", "parameters": [ @@ -49,6 +56,7 @@ "tags": [ "hello-controller" ], + "summary": "Echo 2 string.", "description": "Echo 2 string.", "operationId": "echo2", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app14.json b/springdoc-openapi-javadoc/src/test/resources/results/app14.json index 995120acd..44127638b 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app14.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app14.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/test": { "get": { "tags": [ "hello-controller" ], + "summary": "Demo 2 http entity.", "description": "Demo 2 http entity.", "operationId": "demo2", "responses": { @@ -37,6 +44,7 @@ "tags": [ "hello-controller" ], + "summary": "Persons.", "description": "Persons.", "operationId": "persons", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app140.json b/springdoc-openapi-javadoc/src/test/resources/results/app140.json index 3ccb65c27..41a79d880 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app140.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app140.json @@ -10,12 +10,23 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "greetings-rest-controller", + "description": "The type Greetings rest controller." + }, + { + "name": "person-service", + "description": "The type Person service." + } + ], "paths": { "/greet/{name}": { "get": { "tags": [ "greetings-rest-controller" ], + "summary": "Greet string.", "description": "Greet string.", "operationId": "greet", "parameters": [ @@ -48,6 +59,7 @@ "tags": [ "person-service" ], + "summary": "All set.", "description": "All set.", "operationId": "all", "responses": { @@ -71,6 +83,7 @@ "tags": [ "person-service" ], + "summary": "Save person.", "description": "Save person.", "operationId": "save", "parameters": [ @@ -103,6 +116,7 @@ "tags": [ "person-service" ], + "summary": "By id person.", "description": "By id person.", "operationId": "byId", "parameters": [ @@ -146,8 +160,9 @@ "type": "string", "description": "The Name." } - } + }, + "description": "The type Person." } } } -} +} \ No newline at end of file diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app141.json b/springdoc-openapi-javadoc/src/test/resources/results/app141.json index 224c320ec..0e3a6746a 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app141.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app141.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "book-repository", + "description": "The type Book repository." + } + ], "paths": { "/books": { "get": { "tags": [ "book-repository" ], + "summary": "Find all list.", "description": "Find all list.", "operationId": "findAll", "responses": { @@ -48,6 +55,7 @@ "tags": [ "book-repository" ], + "summary": "Find by author list.", "description": "Find by author list.", "operationId": "findByAuthor", "parameters": [ @@ -91,6 +99,7 @@ "tags": [ "book-repository" ], + "summary": "Find all list.", "description": "Find all list.", "operationId": "findAll_1_1", "responses": { @@ -131,6 +140,7 @@ "tags": [ "book-repository" ], + "summary": "Find by author list.", "description": "Find by author list.", "operationId": "findByAuthor_1", "parameters": [ @@ -166,6 +176,7 @@ "tags": [ "book-repository" ], + "summary": "Find all list.", "description": "Find all list.", "operationId": "findAll_1_2", "responses": { @@ -206,6 +217,7 @@ "tags": [ "book-repository" ], + "summary": "Find by author list.", "description": "Find by author list.", "operationId": "findByAuthor_2", "parameters": [ @@ -241,6 +253,7 @@ "tags": [ "book-repository" ], + "summary": "Find all list.", "description": "Find all list.", "operationId": "findAll_1_3", "responses": { @@ -281,6 +294,7 @@ "tags": [ "book-repository" ], + "summary": "Find by author list.", "description": "Find by author list.", "operationId": "findByAuthor_3", "parameters": [ @@ -316,6 +330,7 @@ "tags": [ "book-repository" ], + "summary": "Find all list.", "description": "Find all list.", "operationId": "findAll_1_4", "responses": { @@ -356,6 +371,7 @@ "tags": [ "book-repository" ], + "summary": "Find by author list.", "description": "Find by author list.", "operationId": "findByAuthor_4", "parameters": [ @@ -404,7 +420,8 @@ "type": "string", "description": "The Author." } - } + }, + "description": "The type Book." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app142.json b/springdoc-openapi-javadoc/src/test/resources/results/app142.json index 3ccb65c27..41a79d880 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app142.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app142.json @@ -10,12 +10,23 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "greetings-rest-controller", + "description": "The type Greetings rest controller." + }, + { + "name": "person-service", + "description": "The type Person service." + } + ], "paths": { "/greet/{name}": { "get": { "tags": [ "greetings-rest-controller" ], + "summary": "Greet string.", "description": "Greet string.", "operationId": "greet", "parameters": [ @@ -48,6 +59,7 @@ "tags": [ "person-service" ], + "summary": "All set.", "description": "All set.", "operationId": "all", "responses": { @@ -71,6 +83,7 @@ "tags": [ "person-service" ], + "summary": "Save person.", "description": "Save person.", "operationId": "save", "parameters": [ @@ -103,6 +116,7 @@ "tags": [ "person-service" ], + "summary": "By id person.", "description": "By id person.", "operationId": "byId", "parameters": [ @@ -146,8 +160,9 @@ "type": "string", "description": "The Name." } - } + }, + "description": "The type Person." } } } -} +} \ No newline at end of file diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app149.json b/springdoc-openapi-javadoc/src/test/resources/results/app149.json index a111389b3..c74a5e52a 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app149.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app149.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "To test the case a user does not use @RestController but puts @Operation on handler methods\n and wants these methods to be exposed." + } + ], "paths": { "/message": { "get": { "tags": [ "hello-controller" ], + "summary": "Message hello message.", "description": "Message hello message.", "operationId": "message", "responses": { @@ -37,6 +44,7 @@ "tags": [ "hello-controller" ], + "summary": "Hello string.", "description": "Hello string.", "operationId": "hello", "responses": { @@ -58,6 +66,7 @@ "tags": [ "hello-controller" ], + "summary": "Hello model and view model and view.", "description": "Hello model and view model and view.", "operationId": "helloModelAndView", "responses": { @@ -89,7 +98,8 @@ "description": "The Number.", "format": "int32" } - } + }, + "description": "The type Hello message." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app15.json b/springdoc-openapi-javadoc/src/test/resources/results/app15.json index c4ddbf0a6..f17381eaf 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app15.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app15.json @@ -21,6 +21,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/persons": { "get": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app150.json b/springdoc-openapi-javadoc/src/test/resources/results/app150.json index 91656005a..e692a44a3 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app150.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app150.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/test/": { "get": { "tags": [ "hello-controller" ], + "summary": "Test.", "description": "Test.", "operationId": "test", "parameters": [ @@ -43,6 +50,7 @@ "tags": [ "hello-controller" ], + "summary": "Test 1.", "description": "Test 1.", "operationId": "test1", "parameters": [ @@ -69,6 +77,7 @@ "tags": [ "hello-controller" ], + "summary": "Test 3.", "description": "Test 3.", "operationId": "test3", "parameters": [ @@ -101,6 +110,7 @@ "tags": [ "hello-controller" ], + "summary": "Test 4.", "description": "Test 4.", "operationId": "test4", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app151.json b/springdoc-openapi-javadoc/src/test/resources/results/app151.json index ec5d5e7e4..c8516a75a 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app151.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app151.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/test": { "get": { "tags": [ "hello-controller" ], + "summary": "Test int.", "description": "Test int.", "operationId": "test", "responses": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app152.json b/springdoc-openapi-javadoc/src/test/resources/results/app152.json index bf036bb07..fb642f2be 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app152.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app152.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/api": { "get": { "tags": [ "hello-controller" ], + "summary": "Hello world string.", "description": "Hello world string.", "operationId": "helloWorld", "responses": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app153.json b/springdoc-openapi-javadoc/src/test/resources/results/app153.json index 0d7a59acf..acbb7e44b 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app153.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app153.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "test-controller", + "description": "The type Test controller." + } + ], "paths": { "/orders": { "get": { "tags": [ "test-controller" ], + "summary": "Method object.", "description": "Method object.", "operationId": "method", "parameters": [ @@ -26,11 +33,11 @@ "required": false, "schema": { "type": "string", + "default": "finished", "enum": [ "finished", "new" - ], - "default": "finished" + ] } } ], diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app154.json b/springdoc-openapi-javadoc/src/test/resources/results/app154.json index ad2f78a68..96b535e0f 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app154.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app154.json @@ -18,12 +18,19 @@ "bearerToken": [] } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/personsone": { "post": { "tags": [ "hello-controller" ], + "summary": "Createone.", "description": "Createone.", "operationId": "createone", "parameters": [ @@ -61,6 +68,7 @@ "tags": [ "hello-controller" ], + "summary": "Create.", "description": "Create.", "operationId": "create", "parameters": [ @@ -98,6 +106,7 @@ "tags": [ "hello-controller" ], + "summary": "Createtwo.", "description": "Createtwo.", "operationId": "createtwo", "parameters": [ @@ -124,6 +133,7 @@ "tags": [ "hello-controller" ], + "summary": "Createthree.", "description": "Createthree.", "operationId": "createthree", "parameters": [ @@ -150,6 +160,7 @@ "tags": [ "hello-controller" ], + "summary": "Hello string.", "description": "Hello string.", "operationId": "hello", "responses": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app155.json b/springdoc-openapi-javadoc/src/test/resources/results/app155.json index 5cc9ecc62..de6d6593f 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app155.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app155.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/test1": { "get": { "tags": [ "hello-controller" ], + "summary": "Say hello response entity.", "description": "Say hello response entity.", "operationId": "sayHello_1", "parameters": [ @@ -72,6 +79,7 @@ "tags": [ "hello-controller" ], + "summary": "Say hello response entity.", "description": "Say hello response entity.", "operationId": "sayHello", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app156.json b/springdoc-openapi-javadoc/src/test/resources/results/app156.json index 785ca5b6f..b8f00eb89 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app156.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app156.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/hello": { "get": { "tags": [ "hello-controller" ], + "summary": "Hello string.", "description": "Hello string.", "operationId": "hello", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app158.json b/springdoc-openapi-javadoc/src/test/resources/results/app158.json index bbdd423ab..26a103259 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app158.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app158.json @@ -13,6 +13,10 @@ "tags": [ { "name": "Operations" + }, + { + "name": "hello-controller", + "description": "The type Hello controller." } ], "paths": { @@ -21,6 +25,7 @@ "tags": [ "hello-controller" ], + "summary": "Hello simple dto.", "description": "Hello simple dto.", "operationId": "hello", "responses": { @@ -57,7 +62,8 @@ "type": "string", "description": "The Message." } - } + }, + "description": "The type Error dto." }, "SimpleDTO": { "type": "object", @@ -66,7 +72,8 @@ "type": "string", "description": "The Payload." } - } + }, + "description": "The type Simple dto." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app159.json b/springdoc-openapi-javadoc/src/test/resources/results/app159.json index 69fce3cd7..44ed0fc5f 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app159.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app159.json @@ -13,6 +13,10 @@ "tags": [ { "name": "Operations" + }, + { + "name": "hello-controller", + "description": "The type Hello controller." } ], "paths": { @@ -21,6 +25,7 @@ "tags": [ "hello-controller" ], + "summary": "Create string.", "description": "Create string.", "operationId": "create", "requestBody": { @@ -79,7 +84,8 @@ "description": "The Code.", "format": "int32" } - } + }, + "description": "The type Foo bean." }, "FooBean_View2": { "type": "object", @@ -93,7 +99,8 @@ "type": "string", "description": "The Message." } - } + }, + "description": "The type Foo bean." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app160.json b/springdoc-openapi-javadoc/src/test/resources/results/app160.json index 5c7dbfdb3..e9db5ab38 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app160.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app160.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/test": { "post": { "tags": [ "hello-controller" ], + "summary": "Do something interesting error response.", "description": "Do something interesting error response.", "operationId": "doSomethingInteresting", "responses": { @@ -41,14 +48,14 @@ ], "type": "object", "properties": { - "errorMessage": { - "type": "string", - "description": "tata" - }, "errorCode": { "type": "integer", "description": "titi", "format": "int32" + }, + "errorMessage": { + "type": "string", + "description": "tata" } }, "description": "toto" diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app161.json b/springdoc-openapi-javadoc/src/test/resources/results/app161.json index 94336c541..56d059dad 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app161.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app161.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/": { "post": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app162.json b/springdoc-openapi-javadoc/src/test/resources/results/app162.json new file mode 100644 index 000000000..9943c5e12 --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/resources/results/app162.json @@ -0,0 +1,252 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "SpringShop API", + "description": "The description of the api", + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "javadoc-only-rest-controller", + "description": "This is the JavadocOnlyRestController class javadoc." + } + ], + "paths": { + "/javadoc-only/{guid}": { + "get": { + "tags": [ + "javadoc-only-rest-controller" + ], + "summary": "This is the find method's javadoc.", + "description": "This is the find method's javadoc.\n The method's signature: #find(String)", + "operationId": "find", + "parameters": [ + { + "name": "guid", + "in": "path", + "description": "the @param guid javadoc for the #find(String) method", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "404": { + "description": "the @throws NoResultException javadoc for the #find(String) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "the @return javadoc for the #find(String) method", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + } + } + } + }, + "put": { + "tags": [ + "javadoc-only-rest-controller" + ], + "summary": "This is the update method's javadoc.", + "description": "This is the update method's javadoc.\n The method's signature: #update(String, JavadocOnlyRestDto)", + "operationId": "update", + "parameters": [ + { + "name": "guid", + "in": "path", + "description": "the @param input javadoc for the #update(String, JavadocOnlyRestDto) method", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + }, + "required": true + }, + "responses": { + "404": { + "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "the @return javadoc for the #update(String, JavadocOnlyRestDto) method", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + } + } + } + } + }, + "/javadoc-only": { + "get": { + "tags": [ + "javadoc-only-rest-controller" + ], + "summary": "This is the list method's javadoc.", + "description": "This is the list method's javadoc.\n The method's signature: #list()", + "operationId": "list", + "responses": { + "200": { + "description": "the @return javadoc for the #list() method", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "javadoc-only-rest-controller" + ], + "summary": "This is the create method's javadoc.", + "description": "This is the create method's javadoc.\n The method's signature: #create(JavadocOnlyRestDto)", + "operationId": "create", + "requestBody": { + "description": "the @param input javadoc for the #create(JavadocOnlyRestDto) method", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "the @return javadoc for the #create(JavadocOnlyRestDto) method", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + } + } + } + } + }, + "/javadoc-only/startsBy/{prefix}": { + "get": { + "tags": [ + "javadoc-only-rest-controller" + ], + "summary": "This is the findStartsBy method's javadoc.", + "description": "This is the findStartsBy method's javadoc.\n The method's signature: #findStartsBy(String)", + "operationId": "findStartsBy", + "parameters": [ + { + "name": "prefix", + "in": "path", + "description": "the @param prefix javadoc for the #findStartsBy(String) method", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "the @throws NonUniqueResultException javadoc for the #findStartsBy(String) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "the @throws NoResultException javadoc for the #findStartsBy(String) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "the @return javadoc for the #findStartsBy(String) method", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JavadocOnlyRestDto" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "JavadocOnlyRestDto": { + "type": "object", + "properties": { + "guid": { + "type": "string", + "description": "This is the private #guid field's javadoc." + }, + "inner": { + "$ref": "#/components/schemas/JavadocOnlyStaticInnerRestDto" + } + }, + "description": "This is the JavadocOnlyRestDto class javadoc." + }, + "JavadocOnlyStaticInnerRestDto": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "This is the private #content field's javadoc." + } + }, + "description": "This is the JavadocOnlyStaticInnerRestDto class javadoc." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app163.json b/springdoc-openapi-javadoc/src/test/resources/results/app163.json new file mode 100644 index 000000000..d3c7dd7d7 --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/resources/results/app163.json @@ -0,0 +1,182 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "SpringShop API", + "description": "The description of the api", + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "annotation-override", + "description": "Description for the tag." + } + ], + "paths": { + "/annotation-override/{guid}": { + "put": { + "tags": [ + "annotation-override" + ], + "summary": "Summary for #update(String, AnnotationOverrideForJavadocRestDto)", + "description": "This is the update method's javadoc.\n The method's signature: #update(String, AnnotationOverrideForJavadocRestDto)", + "operationId": "update", + "parameters": [ + { + "name": "guid", + "in": "path", + "description": "the @param input javadoc for the #update(String, AnnotationOverrideForJavadocRestDto) method", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AnnotationOverrideForJavadocRestDto" + } + } + }, + "required": true + }, + "responses": { + "404": { + "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "the @return javadoc for the #update(String, AnnotationOverrideForJavadocRestDto) method", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AnnotationOverrideForJavadocRestDto" + } + } + } + } + } + } + }, + "/annotation-override": { + "post": { + "tags": [ + "annotation-override" + ], + "summary": "Summary for #create(AnnotationOverrideForJavadocRestDto)", + "description": "Description for #create(AnnotationOverrideForJavadocRestDto)", + "operationId": "create", + "requestBody": { + "description": "Request body for #create(AnnotationOverrideForJavadocRestDto)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AnnotationOverrideForJavadocRestDto" + } + } + }, + "required": true + }, + "responses": { + "default": { + "description": "API Response 201 for #create(AnnotationOverrideForJavadocRestDto)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AnnotationOverrideForJavadocRestDto" + } + } + } + } + } + } + }, + "/annotation-override/startsBy/{prefix}": { + "get": { + "tags": [ + "annotation-override" + ], + "summary": "This is the findStartsBy method's javadoc.", + "description": "This is the findStartsBy method's javadoc.\n The method's signature: #findStartsBy(String)", + "operationId": "findStartsBy", + "parameters": [ + { + "name": "prefix", + "in": "path", + "description": "Parameter prefix", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "400": { + "description": "API Response 400 for #findStartsBy(prefix)" + }, + "404": { + "description": "the @throws NoResultException javadoc for the #findStartsBy(String) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "API Response 200 for #findStartsBy(prefix)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AnnotationOverrideForJavadocRestDto" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AnnotationOverrideForJavadocRestDto": { + "title": "annotation-override-dto", + "type": "object", + "properties": { + "guid": { + "type": "string", + "description": "Description for the #guid field" + }, + "inner": { + "$ref": "#/components/schemas/AnnotationOverrideForJavadocStaticInnerRestDto" + } + }, + "description": "Description for the tag." + }, + "AnnotationOverrideForJavadocStaticInnerRestDto": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "This is the private #content field's javadoc." + } + }, + "description": "This is the AnnotationOverrideForJavadocStaticInnerRestDto class javadoc." + } + } + } +} \ No newline at end of file diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app164.json b/springdoc-openapi-javadoc/src/test/resources/results/app164.json new file mode 100644 index 000000000..7497007a5 --- /dev/null +++ b/springdoc-openapi-javadoc/src/test/resources/results/app164.json @@ -0,0 +1,129 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "SpringShop API", + "description": "The description of the api", + "version": "v1" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "no-generic-override-rest-controller", + "description": "This is the JavadocOnlyRestController class javadoc." + } + ], + "paths": { + "/no-generic-override": { + "post": { + "tags": [ + "no-generic-override-rest-controller" + ], + "summary": "This is the create method's javadoc.", + "description": "This is the create method's javadoc.\n The method's signature: #create(JavadocOnlyRestDto)", + "operationId": "create", + "requestBody": { + "description": "the @param input javadoc for the #create(JavadocOnlyRestDto) method", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "404": { + "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "201": { + "description": "the @return javadoc for the #create(JavadocOnlyRestDto) method", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/no-generic-override/startsBy/{prefix}": { + "get": { + "tags": [ + "no-generic-override-rest-controller" + ], + "summary": "This is the findStartsBy method's javadoc.", + "description": "This is the findStartsBy method's javadoc.\n The method's signature: #findStartsBy(String)", + "operationId": "findStartsBy", + "parameters": [ + { + "name": "prefix", + "in": "path", + "description": "the @param prefix javadoc for the #findStartsBy(String) method", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "404": { + "description": "the return javadoc for the #handleNotFoundException(NoResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "the return javadoc for the #handleNonUniqueResultException(NonUniqueResultException) method", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + }, + "200": { + "description": "the @return javadoc for the #findStartsBy(String) method", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app17.json b/springdoc-openapi-javadoc/src/test/resources/results/app17.json index d77ff5d0f..cc03cd615 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app17.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app17.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/persons": { "get": { "tags": [ "hello-controller" ], + "summary": "Persons.", "description": "Persons.", "operationId": "persons", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app18.json b/springdoc-openapi-javadoc/src/test/resources/results/app18.json index cfda5e240..8e2d55683 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app18.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app18.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/persons": { "get": { "tags": [ "hello-controller" ], + "summary": "Persons string.", "description": "Persons string.", "operationId": "persons", "parameters": [ @@ -48,6 +55,7 @@ "tags": [ "hello-controller" ], + "summary": "Persons 6 string.", "description": "Persons 6 string.", "operationId": "persons6", "parameters": [ @@ -80,6 +88,7 @@ "tags": [ "hello-controller" ], + "summary": "Persons 5 string.", "description": "Persons 5 string.", "operationId": "persons5", "parameters": [ @@ -114,6 +123,7 @@ "tags": [ "hello-controller" ], + "summary": "Persons 4 string.", "description": "Persons 4 string.", "operationId": "persons4", "parameters": [ @@ -148,6 +158,7 @@ "tags": [ "hello-controller" ], + "summary": "Persons 3 string.", "description": "Persons 3 string.", "operationId": "persons3", "parameters": [ @@ -180,6 +191,7 @@ "tags": [ "hello-controller" ], + "summary": "Persons 2 string.", "description": "Persons 2 string.", "operationId": "persons2", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app19.json b/springdoc-openapi-javadoc/src/test/resources/results/app19.json index 896d2536f..3dd1c963f 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app19.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app19.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/persons": { "post": { "tags": [ "hello-controller" ], + "summary": "Persons string.", "description": "Persons string.", "operationId": "persons", "requestBody": { @@ -47,6 +54,7 @@ "tags": [ "hello-controller" ], + "summary": "Persons 3 string.", "description": "Persons 3 string.", "operationId": "persons3", "requestBody": { @@ -79,6 +87,7 @@ "tags": [ "hello-controller" ], + "summary": "Persons 2 string.", "description": "Persons 2 string.", "operationId": "persons2", "requestBody": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app2.json b/springdoc-openapi-javadoc/src/test/resources/results/app2.json index 5d35ca280..e63263ee8 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app2.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app2.json @@ -64,8 +64,8 @@ } } }, - "404": { - "description": "User not found", + "200": { + "description": "successful operation", "content": { "application/xml": { "schema": { @@ -79,8 +79,8 @@ } } }, - "200": { - "description": "successful operation", + "404": { + "description": "User not found", "content": { "application/xml": { "schema": { @@ -1149,7 +1149,8 @@ "description": "User Status", "format": "int32" } - } + }, + "description": "The type User." }, "Category": { "type": "object", @@ -1206,7 +1207,8 @@ "sold" ] } - } + }, + "description": "The type Pet." }, "Tag": { "type": "object", @@ -1251,7 +1253,8 @@ "type": "string", "description": "Order Status" } - } + }, + "description": "The type Order." }, "ModelApiResponse": { "type": "object", @@ -1269,7 +1272,8 @@ "type": "string", "description": "The Message." } - } + }, + "description": "The type Model api response." } }, "securitySchemes": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app22.json b/springdoc-openapi-javadoc/src/test/resources/results/app22.json index 1238f6fcb..3060dd3fd 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app22.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app22.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/persons": { "get": { "tags": [ "hello-controller" ], + "summary": "Do get response entity.", "description": "Do get response entity.", "operationId": "doGet", "responses": { @@ -56,7 +63,8 @@ "type": "string", "description": "The Last name." } - } + }, + "description": "The type Person dto." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app23.json b/springdoc-openapi-javadoc/src/test/resources/results/app23.json index 7ba5213bd..4065f7c35 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app23.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app23.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/persons": { "get": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app24.json b/springdoc-openapi-javadoc/src/test/resources/results/app24.json index 3f42288b6..fefdd6375 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app24.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app24.json @@ -16,6 +16,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/persons": { "get": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app25.json b/springdoc-openapi-javadoc/src/test/resources/results/app25.json index af654b087..3c965a6a9 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app25.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app25.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/values/{trackerId}/data": { "get": { @@ -74,6 +80,7 @@ "tags": [ "hello-controller" ], + "summary": "Secondlist.", "description": "Secondlist.", "operationId": "secondlist", "parameters": [ @@ -122,6 +129,7 @@ "tags": [ "hello-controller" ], + "summary": "List.", "description": "List.", "operationId": "list", "parameters": [ @@ -170,6 +178,7 @@ "tags": [ "hello-controller" ], + "summary": "Check.", "description": "Check.", "operationId": "check", "responses": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app26.json b/springdoc-openapi-javadoc/src/test/resources/results/app26.json index 7bb2b8184..0129981f8 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app26.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app26.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/persons": { "post": { "tags": [ "hello-controller" ], + "summary": "Persons my model.", "description": "Persons my model.", "operationId": "persons", "parameters": [ @@ -53,8 +60,9 @@ "type": "object", "description": "Hello" } - } + }, + "description": "The type My model." } } } -} +} \ No newline at end of file diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app28.json b/springdoc-openapi-javadoc/src/test/resources/results/app28.json index cae927560..f08e05f10 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app28.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app28.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/upload2": { "post": { "tags": [ "hello-controller" ], + "summary": "Upload 2 string.", "description": "Upload 2 string.", "operationId": "upload2", "requestBody": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app29.json b/springdoc-openapi-javadoc/src/test/resources/results/app29.json index 9a31d9b65..719b09457 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app29.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app29.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/post-entity": { "post": { @@ -73,7 +79,8 @@ "format": "double", "example": 19.0 } - } + }, + "description": "The type Tracker data." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app3.json b/springdoc-openapi-javadoc/src/test/resources/results/app3.json index 637576af6..5333cf8d3 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app3.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app3.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/": { "post": { "tags": [ "hello-controller" ], + "summary": "Echo playing card.", "description": "Echo playing card.", "operationId": "echo", "parameters": [ @@ -80,7 +87,8 @@ "description": "The Toto.", "format": "date-time" } - } + }, + "description": "The type Playing card." }, "PersonDTO": { "type": "object", @@ -97,7 +105,8 @@ "type": "string", "description": "The lastName" } - } + }, + "description": "The type Person dto." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app30.json b/springdoc-openapi-javadoc/src/test/resources/results/app30.json index 2c648d7a6..5060fc677 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app30.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app30.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/test": { "get": { "tags": [ "hello-controller" ], + "summary": "Echo string.", "description": "Echo string.", "operationId": "echo", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app31.json b/springdoc-openapi-javadoc/src/test/resources/results/app31.json index 7bd83b90a..28b984940 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app31.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app31.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/test": { "post": { @@ -97,7 +103,8 @@ "type": "string", "description": "The Subscription uuid." } - } + }, + "description": "The type Subscription response." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app32.json b/springdoc-openapi-javadoc/src/test/resources/results/app32.json index 24ccd737c..7d091ddda 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app32.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app32.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/filter": { "post": { "tags": [ "hello-controller" ], + "summary": "Filter post string.", "description": "Filter post string.", "operationId": "filterPost", "requestBody": { @@ -60,7 +67,8 @@ "type": "string", "description": "The Object 3." } - } + }, + "description": "The type My test dto." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app33.json b/springdoc-openapi-javadoc/src/test/resources/results/app33.json index 9827ac77e..c46c7d760 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app33.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app33.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/hello/{numTelco}": { "get": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app34.json b/springdoc-openapi-javadoc/src/test/resources/results/app34.json index 9827ac77e..c46c7d760 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app34.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app34.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/hello/{numTelco}": { "get": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app35.json b/springdoc-openapi-javadoc/src/test/resources/results/app35.json index 31dbe2c21..61252406e 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app35.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app35.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/api/v1/poc/testme": { "get": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app37.json b/springdoc-openapi-javadoc/src/test/resources/results/app37.json index f11428269..29db92173 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app37.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app37.json @@ -10,27 +10,63 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { - "/pets2": { + "/bar/baz": { "post": { "tags": [ "hello-controller" ], - "description": "Pets post response entity.", - "operationId": "petsPost2", + "summary": "Process car.", + "description": "Process car.", + "operationId": "process_1_1", "requestBody": { - "description": "the pet", + "description": "the c", "content": { - "application/json": { + "application/x.a+json": { "schema": { - "$ref": "#/components/schemas/Pet" + "$ref": "#/components/schemas/Foo" + } + }, + "application/x.b+json": { + "schema": { + "$ref": "#/components/schemas/Bar" + } + }, + "application/x.c+json": { + "schema": { + "$ref": "#/components/schemas/Car" } } } }, "responses": { "200": { - "description": "the response entity" + "description": "the car", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Car" + } + }, + "text/plain": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Foo" + }, + { + "$ref": "#/components/schemas/Bar" + } + ] + } + } + } } } } @@ -40,6 +76,7 @@ "tags": [ "hello-controller" ], + "summary": "Pets post response entity.", "description": "Pets post response entity.", "operationId": "petsPost1", "requestBody": { @@ -59,55 +96,27 @@ } } }, - "/bar/baz": { + "/pets2": { "post": { "tags": [ "hello-controller" ], - "description": "Process car.", - "operationId": "process_1_1", + "summary": "Pets post response entity.", + "description": "Pets post response entity.", + "operationId": "petsPost2", "requestBody": { - "description": "the c", + "description": "the pet", "content": { - "application/x.c+json": { - "schema": { - "$ref": "#/components/schemas/Car" - } - }, - "application/x.b+json": { - "schema": { - "$ref": "#/components/schemas/Bar" - } - }, - "application/x.a+json": { + "application/json": { "schema": { - "$ref": "#/components/schemas/Foo" + "$ref": "#/components/schemas/Pet" } } } }, "responses": { "200": { - "description": "the car", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Car" - } - }, - "text/plain": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/Foo" - }, - { - "$ref": "#/components/schemas/Bar" - } - ] - } - } - } + "description": "the response entity" } } } @@ -115,14 +124,15 @@ }, "components": { "schemas": { - "Pet": { + "Bar": { "type": "object", "properties": { - "pet": { + "bar": { "type": "string", - "description": "The Pet." + "description": "The Bar." } - } + }, + "description": "The type Bar." }, "Car": { "type": "object", @@ -131,25 +141,28 @@ "type": "string", "description": "The Car." } - } + }, + "description": "The type Car." }, - "Bar": { + "Foo": { "type": "object", "properties": { - "bar": { + "foo": { "type": "string", - "description": "The Bar." + "description": "The Foo." } - } + }, + "description": "The type Foo." }, - "Foo": { + "Pet": { "type": "object", "properties": { - "foo": { + "pet": { "type": "string", - "description": "The Foo." + "description": "The Pet." } - } + }, + "description": "The type Pet." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app38.json b/springdoc-openapi-javadoc/src/test/resources/results/app38.json index 5bbe8ac11..b6127e78c 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app38.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app38.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/npe_error": { "get": { "tags": [ "hello-controller" ], + "summary": "Gets model resource.", "description": "Gets model resource.", "operationId": "getModelResource", "responses": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app39.json b/springdoc-openapi-javadoc/src/test/resources/results/app39.json index 6fd8cde65..eae97040c 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app39.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app39.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/hello": { "get": { "tags": [ "hello-controller" ], + "summary": "Hello string.", "description": "Hello string.", "operationId": "hello", "parameters": [ @@ -74,9 +81,9 @@ "components": { "parameters": { "myGlobalHeader": { - "description": "My Global Header", - "in": "header", "name": "My-Global-Header", + "in": "header", + "description": "My Global Header", "required": true, "schema": { "type": "string" diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app4.json b/springdoc-openapi-javadoc/src/test/resources/results/app4.json index 82668bcf3..5b08ca8ce 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app4.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app4.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/values/data": { "post": { "tags": [ "hello-controller" ], + "summary": "List tracker data.", "description": "List tracker data.", "operationId": "list", "parameters": [ @@ -71,8 +78,9 @@ "format": "double", "example": 19.0 } - } + }, + "description": "The type Tracker data." } } } -} +} \ No newline at end of file diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app40.json b/springdoc-openapi-javadoc/src/test/resources/results/app40.json index 5101046f9..1a7e1f820 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app40.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app40.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/iae_error": { "get": { "tags": [ "hello-controller" ], + "summary": "Gets start form properties.", "description": "Gets start form properties.", "operationId": "getStartFormProperties", "responses": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app42.json b/springdoc-openapi-javadoc/src/test/resources/results/app42.json index e867c531a..a57583c95 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app42.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app42.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/tweets": { "get": { "tags": [ "hello-controller" ], + "summary": "Tweets.", "description": "Tweets.", "operationId": "tweets", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app43.json b/springdoc-openapi-javadoc/src/test/resources/results/app43.json index 8e8720e51..ad707ae07 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app43.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app43.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/documents": { "post": { "tags": [ "hello-controller" ], + "summary": "Upload documents response entity.", "description": "Upload documents response entity.", "operationId": "uploadDocuments", "requestBody": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app45.json b/springdoc-openapi-javadoc/src/test/resources/results/app45.json index 3f90ea3eb..bc011712a 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app45.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app45.json @@ -151,7 +151,8 @@ "type": "string", "description": "The Last name." } - } + }, + "description": "The type Person dto." } }, "securitySchemes": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app47.json b/springdoc-openapi-javadoc/src/test/resources/results/app47.json index f7a930f81..ba42049cb 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app47.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app47.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/documents/{locale}": { "get": { "tags": [ "hello-controller" ], + "summary": "Gets documents with locale.", "description": "Gets documents with locale.", "operationId": "getDocumentsWithLocale", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app48.json b/springdoc-openapi-javadoc/src/test/resources/results/app48.json index 628d14ecc..e89e93aa5 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app48.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app48.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/documents/{locale}": { "get": { "tags": [ "hello-controller" ], + "summary": "Gets documents.", "description": "Gets documents.", "operationId": "getDocuments", "responses": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app49.json b/springdoc-openapi-javadoc/src/test/resources/results/app49.json index 564e48566..e36b13f06 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app49.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app49.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/hello": { "get": { @@ -40,4 +46,4 @@ } } } -} +} \ No newline at end of file diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app50.json b/springdoc-openapi-javadoc/src/test/resources/results/app50.json index 7b159b6bd..f81152e83 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app50.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app50.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/hello": { "get": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app51.json b/springdoc-openapi-javadoc/src/test/resources/results/app51.json index 3695aa5e8..dec08d84e 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app51.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app51.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/": { "post": { "tags": [ "hello-controller" ], + "summary": "Hello response entity.", "description": "Hello response entity.", "operationId": "hello", "requestBody": { @@ -54,6 +61,7 @@ "tags": [ "hello-controller" ], + "summary": "Get string.", "description": "Get string.", "operationId": "get", "parameters": [ @@ -86,6 +94,7 @@ "tags": [ "hello-controller" ], + "summary": "Test 3 string.", "description": "Test 3 string.", "operationId": "test3", "parameters": [ @@ -128,6 +137,7 @@ "tags": [ "hello-controller" ], + "summary": "Test 2 string.", "description": "Test 2 string.", "operationId": "test2", "parameters": [ @@ -169,6 +179,7 @@ "tags": [ "hello-controller" ], + "summary": "Test 1 string.", "description": "Test 1 string.", "operationId": "test1", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app52.json b/springdoc-openapi-javadoc/src/test/resources/results/app52.json index 57b2804a7..bc51235e7 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app52.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app52.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/test1/{username}": { "post": { "tags": [ "hello-controller" ], + "summary": "Create test 1 string.", "description": "Create test 1 string.", "operationId": "createTest1", "parameters": [ @@ -71,6 +78,7 @@ "tags": [ "hello-controller" ], + "summary": "Create test 2 string.", "description": "Create test 2 string.", "operationId": "createTest2", "parameters": [ @@ -126,6 +134,7 @@ "tags": [ "hello-controller" ], + "summary": "Create test 3 string.", "description": "Create test 3 string.", "operationId": "createTest3", "requestBody": { @@ -186,7 +195,8 @@ "type": "string", "description": "The Object 3." } - } + }, + "description": "The type My test dto." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app53.json b/springdoc-openapi-javadoc/src/test/resources/results/app53.json index 85a359a4c..db58b2389 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app53.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app53.json @@ -10,6 +10,16 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + }, + { + "name": "hello-controller-with-global-api-response", + "description": "The type Hello controller with global api response." + } + ], "paths": { "/hello7": { "get": { @@ -228,7 +238,8 @@ "type": "string", "description": "The Message." } - } + }, + "description": "The type Hello dto 1." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app54.json b/springdoc-openapi-javadoc/src/test/resources/results/app54.json index 58f996479..9b8e86c58 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app54.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app54.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/parties": { "post": { "tags": [ "hello-controller" ], + "summary": "Save meal party response entity.", "description": "Save meal party response entity.", "operationId": "saveMealParty", "requestBody": { @@ -47,6 +54,7 @@ "tags": [ "hello-controller" ], + "summary": "Save meal new party response entity.", "description": "Save meal new party response entity.", "operationId": "saveMealNewParty", "requestBody": { @@ -118,7 +126,8 @@ "type": "string", "description": "The Name." } - } + }, + "description": "The type Meal party." }, "MealParty_MealPartyAdmin": { "type": "object", @@ -134,7 +143,8 @@ "type": "string" } } - } + }, + "description": "The type Meal party." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app56.json b/springdoc-openapi-javadoc/src/test/resources/results/app56.json index e3dbac1c1..57e28f808 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app56.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app56.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/persons": { "get": { "tags": [ "hello-controller" ], + "summary": "Persons string.", "description": "Persons string.", "operationId": "persons", "responses": { @@ -52,7 +59,8 @@ "type": "string", "description": "The Error message." } - } + }, + "description": "The type Error dto." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app57.json b/springdoc-openapi-javadoc/src/test/resources/results/app57.json index 0e6af7709..8227604c3 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app57.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app57.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/{name}": { "get": { "tags": [ "hello-controller" ], + "summary": "Gets text.", "description": "Gets text.", "operationId": "getText", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app58.json b/springdoc-openapi-javadoc/src/test/resources/results/app58.json index 512137b5a..933a0012a 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app58.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app58.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/examplePost": { "post": { @@ -38,6 +44,7 @@ "tags": [ "hello-controller" ], + "summary": "Foobar.", "description": "Foobar.", "operationId": "foobar", "parameters": [ @@ -63,6 +70,7 @@ "tags": [ "hello-controller" ], + "summary": "Foobar 1.", "description": "Foobar 1.", "operationId": "foobar1", "parameters": [ @@ -92,6 +100,7 @@ "tags": [ "hello-controller" ], + "summary": "Test.", "description": "Test.", "operationId": "test", "responses": { @@ -119,7 +128,8 @@ "type": "string", "description": "The Last name." } - } + }, + "description": "The type Person dto." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app59.json b/springdoc-openapi-javadoc/src/test/resources/results/app59.json index 7d0e461e5..23529af7e 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app59.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app59.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/example": { "get": { "tags": [ "hello-controller" ], + "summary": "Test.", "description": "Test.", "operationId": "test", "responses": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app6.json b/springdoc-openapi-javadoc/src/test/resources/results/app6.json index 692857e27..231161b7e 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app6.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app6.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/hello": { "get": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app60.json b/springdoc-openapi-javadoc/src/test/resources/results/app60.json index 88b8edba1..f198a6f62 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app60.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app60.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/hello2": { "get": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app61.json b/springdoc-openapi-javadoc/src/test/resources/results/app61.json index d8aa83767..64b0a15d8 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app61.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app61.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/persons-with-user": { "get": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app64.json b/springdoc-openapi-javadoc/src/test/resources/results/app64.json index 84157c8b2..ee7fbc962 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app64.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app64.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/api/balance/abcd": { "get": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app67.json b/springdoc-openapi-javadoc/src/test/resources/results/app67.json index 29a727c19..8d4b44e22 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app67.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app67.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/demo/operation4": { "get": { @@ -179,4 +185,4 @@ } }, "components": {} -} +} \ No newline at end of file diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app69.json b/springdoc-openapi-javadoc/src/test/resources/results/app69.json index 481467deb..4dd23f596 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app69.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app69.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/tasks": { "get": { "tags": [ "hello-controller" ], + "summary": "Gets tasks.", "description": "Gets tasks.", "operationId": "getTasks", "parameters": [ @@ -61,7 +68,8 @@ "type": "string", "description": "The Last name." } - } + }, + "description": "The type Person dto." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app7.json b/springdoc-openapi-javadoc/src/test/resources/results/app7.json index 3b377b238..be87f1ca0 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app7.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app7.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/test": { "post": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app70.json b/springdoc-openapi-javadoc/src/test/resources/results/app70.json index 893601cc2..4533ce2c3 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app70.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app70.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/example/{test}": { "get": { @@ -55,7 +61,8 @@ "description": "The Some property.", "format": "duration" } - } + }, + "description": "The type Api type." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app71.json b/springdoc-openapi-javadoc/src/test/resources/results/app71.json index 069c784b4..a8a4c85a3 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app71.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app71.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/persons": { "post": { "tags": [ "hello-controller" ], + "summary": "Persons string.", "description": "Persons string.", "operationId": "persons", "parameters": [ @@ -54,8 +61,9 @@ "description": "A name given to the Dog", "example": "Fido" } - } + }, + "description": "The type Dog." } } } -} +} \ No newline at end of file diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app73.json b/springdoc-openapi-javadoc/src/test/resources/results/app73.json index a5a4afab3..7c643184f 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app73.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app73.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/{country_code}/persons/{id}": { "get": { "tags": [ "hello-controller" ], + "summary": "Get string.", "description": "Get string.", "operationId": "get", "parameters": [ @@ -55,6 +62,7 @@ "tags": [ "hello-controller" ], + "summary": "Delete.", "description": "Delete.", "operationId": "delete", "parameters": [ @@ -89,6 +97,7 @@ "tags": [ "hello-controller" ], + "summary": "Get string.", "description": "Get string.", "operationId": "get_1", "parameters": [ @@ -128,6 +137,7 @@ "tags": [ "hello-controller" ], + "summary": "Delete.", "description": "Delete.", "operationId": "delete_1", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app74.json b/springdoc-openapi-javadoc/src/test/resources/results/app74.json index 16df98bc6..693f42f5b 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app74.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app74.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/test": { "post": { "tags": [ "hello-controller" ], + "summary": "Post my request body string.", "description": "Post my request body string.", "operationId": "postMyRequestBody", "requestBody": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app75.json b/springdoc-openapi-javadoc/src/test/resources/results/app75.json index 4c79cdbf2..f31de5ef5 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app75.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app75.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/test3": { "post": { @@ -164,7 +170,8 @@ "type": "string", "description": "The Last name." } - } + }, + "description": "The type Person dto." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app76.json b/springdoc-openapi-javadoc/src/test/resources/results/app76.json index 24cdc4c55..fb602de09 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app76.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app76.json @@ -18,12 +18,19 @@ ] } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/secure": { "get": { "tags": [ "hello-controller" ], + "summary": "Secured string.", "description": "Secured string.", "operationId": "secured", "responses": { @@ -45,6 +52,7 @@ "tags": [ "hello-controller" ], + "summary": "Open string.", "description": "Open string.", "operationId": "open", "responses": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app77.json b/springdoc-openapi-javadoc/src/test/resources/results/app77.json index 839625189..5698d54ac 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app77.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app77.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/persons": { "get": { "tags": [ "hello-controller" ], + "summary": "Persons.", "description": "Persons.", "operationId": "persons", "parameters": [ @@ -49,6 +56,7 @@ "tags": [ "hello-controller" ], + "summary": "Persons 2.", "description": "Persons 2.", "operationId": "persons2", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app78.json b/springdoc-openapi-javadoc/src/test/resources/results/app78.json index 798c4117e..516a84f75 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app78.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app78.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/person2": { "get": { "tags": [ "hello-controller" ], + "summary": "Gets person 2.", "description": "Gets person 2.", "operationId": "getPerson2", "parameters": [ @@ -48,6 +55,7 @@ "tags": [ "hello-controller" ], + "summary": "Gets person 1.", "description": "Gets person 1.", "operationId": "getPerson1", "parameters": [ @@ -93,7 +101,8 @@ "type": "string", "description": "The Last name." } - } + }, + "description": "The type Person dto." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app79.json b/springdoc-openapi-javadoc/src/test/resources/results/app79.json index ee620c882..ba551f103 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app79.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app79.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/test": { "get": { "tags": [ "hello-controller" ], + "summary": "Echo string.", "description": "Echo string.", "operationId": "echo", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app80.json b/springdoc-openapi-javadoc/src/test/resources/results/app80.json index 6be71925c..e3962caa9 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app80.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app80.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/api/hello": { "get": { "tags": [ "hello-controller" ], + "summary": "Hello response entity.", "description": "Hello response entity.", "operationId": "hello", "responses": { @@ -37,6 +44,7 @@ "tags": [ "hello-controller" ], + "summary": "Testpost 1 response entity.", "description": "Testpost 1 response entity.", "operationId": "testpost1", "requestBody": { @@ -79,7 +87,8 @@ "type": "string", "description": "The String value." } - } + }, + "description": "The type Test object." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app82.json b/springdoc-openapi-javadoc/src/test/resources/results/app82.json index b3758d09e..5876a3d5c 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app82.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app82.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/test": { "put": { "tags": [ "hello-controller" ], + "summary": "Put response entity.", "description": "Put response entity.", "operationId": "put", "parameters": [ @@ -79,7 +86,8 @@ "type": "string", "description": "The Last name." } - } + }, + "description": "The type Person dto." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app83.json b/springdoc-openapi-javadoc/src/test/resources/results/app83.json index 41f019c89..0695068ca 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app83.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app83.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/{config}": { "put": { "tags": [ "hello-controller" ], + "summary": "Put response entity.", "description": "Put response entity.", "operationId": "put", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app84.json b/springdoc-openapi-javadoc/src/test/resources/results/app84.json index ce77a63b6..c80e3eb70 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app84.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app84.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/api/persons": { "get": { "tags": [ "hello-controller" ], + "summary": "Persons string.", "description": "Persons string.", "operationId": "persons", "responses": { @@ -37,6 +44,7 @@ "tags": [ "hello-controller" ], + "summary": "Persons string.", "description": "Persons string.", "operationId": "persons_1", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app85.json b/springdoc-openapi-javadoc/src/test/resources/results/app85.json index c047cc69e..622d1036a 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app85.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app85.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/api/test/{id}": { "post": { "tags": [ "hello-controller" ], + "summary": "Testme.", "description": "Testme.", "operationId": "testme", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app86.json b/springdoc-openapi-javadoc/src/test/resources/results/app86.json index 773563c34..a884f63c7 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app86.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app86.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/test": { "get": { "tags": [ "hello-controller" ], + "summary": "Test.", "description": "Test.", "operationId": "test", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app87.json b/springdoc-openapi-javadoc/src/test/resources/results/app87.json index d5da3eccb..3b9078ccb 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app87.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app87.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/{itemId}": { "put": { "tags": [ "hello-controller" ], + "summary": "Put item response entity.", "description": "Put item response entity.", "operationId": "putItem", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app88.json b/springdoc-openapi-javadoc/src/test/resources/results/app88.json index 5647c5282..6dea24fc3 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app88.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app88.json @@ -13,6 +13,7 @@ "paths": { "/persons": { "get": { + "summary": "Persons string.", "description": "Persons string.", "operationId": "persons", "responses": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app89.json b/springdoc-openapi-javadoc/src/test/resources/results/app89.json index 4625947ff..fb71f77e6 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app89.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app89.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/status": { "get": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app9.json b/springdoc-openapi-javadoc/src/test/resources/results/app9.json index 0f9ee3aab..681ecae08 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app9.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app9.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "my-api-controller", + "description": "The type My api controller." + } + ], "paths": { "/myapi": { "get": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app90.json b/springdoc-openapi-javadoc/src/test/resources/results/app90.json index c5a5f0045..fd8099c4e 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app90.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app90.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/test2": { "post": { "tags": [ "hello-controller" ], + "summary": "Test 2.", "description": "Test 2.", "operationId": "test2", "requestBody": { @@ -53,6 +60,7 @@ "tags": [ "hello-controller" ], + "summary": "Test 1.", "description": "Test 1.", "operationId": "test1", "parameters": [ @@ -138,7 +146,8 @@ "format": "int32", "example": 1 } - } + }, + "description": "User" } }, "examples": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app91.json b/springdoc-openapi-javadoc/src/test/resources/results/app91.json index d4542760b..7fd0db639 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app91.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app91.json @@ -44,6 +44,7 @@ "tags": [ "Demo" ], + "summary": "Say hello 2 response entity.", "description": "Say hello 2 response entity.", "operationId": "sayHello2", "responses": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app92.json b/springdoc-openapi-javadoc/src/test/resources/results/app92.json index 290da873c..3c8e5652f 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app92.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app92.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/test": { "get": { "tags": [ "hello-controller" ], + "summary": "Index string.", "description": "Index string.", "operationId": "index", "parameters": [ diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app93.json b/springdoc-openapi-javadoc/src/test/resources/results/app93.json index 2361f6ba8..d8c40eab9 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app93.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app93.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "specific-controller", + "description": "The type Specific controller." + } + ], "paths": { "/": { "get": { "tags": [ "specific-controller" ], + "summary": "Get t client model.", "description": "Get t client model.", "operationId": "get", "parameters": [ @@ -58,7 +65,8 @@ "type": "string", "description": "The Name." } - } + }, + "description": "The type Specific client model." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app94.json b/springdoc-openapi-javadoc/src/test/resources/results/app94.json index 8488012c2..55fe3e579 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app94.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app94.json @@ -22,6 +22,7 @@ "tags": [ "Demo" ], + "summary": "Say hello 2 response entity.", "description": "Say hello 2 response entity.", "operationId": "sayHello2", "responses": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app95.json b/springdoc-openapi-javadoc/src/test/resources/results/app95.json index 38cfbdce9..c9cd94232 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app95.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app95.json @@ -10,6 +10,12 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/persons": { "get": { @@ -39,4 +45,4 @@ } }, "components": {} -} +} \ No newline at end of file diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app96.json b/springdoc-openapi-javadoc/src/test/resources/results/app96.json index fceac5541..d84695fed 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app96.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app96.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/api1": { "post": { "tags": [ "hello-controller" ], + "summary": "Test 1 string.", "description": "Test 1 string.", "operationId": "test1", "requestBody": { @@ -50,6 +57,7 @@ "tags": [ "hello-controller" ], + "summary": "Test 2 string.", "description": "Test 2 string.", "operationId": "test2", "requestBody": { @@ -82,6 +90,7 @@ "tags": [ "hello-controller" ], + "summary": "Test 3 string.", "description": "Test 3 string.", "operationId": "test3", "requestBody": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app97.json b/springdoc-openapi-javadoc/src/test/resources/results/app97.json index d20569cd3..ec408d329 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app97.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app97.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/api/student/header3": { "get": { "tags": [ "hello-controller" ], + "summary": "Header v 3 student v 3.", "description": "Header v 3 student v 3.", "operationId": "headerV3", "parameters": [ @@ -46,6 +53,7 @@ "tags": [ "hello-controller" ], + "summary": "Header v 2 student v 2.", "description": "Header v 2 student v 2.", "operationId": "headerV2", "parameters": [ @@ -79,6 +87,7 @@ "tags": [ "hello-controller" ], + "summary": "Header v 1 student v 1.", "description": "Header v 1 student v 1.", "operationId": "headerV1", "parameters": [ @@ -117,7 +126,8 @@ "type": "string", "description": "The Name." } - } + }, + "description": "The type Student v 3." }, "StudentV2": { "type": "object", @@ -126,7 +136,8 @@ "type": "string", "description": "The Name." } - } + }, + "description": "The type Student v 2." }, "StudentV1": { "type": "object", @@ -135,7 +146,8 @@ "type": "string", "description": "The Name." } - } + }, + "description": "The type Student v 1." } } } diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app98.json b/springdoc-openapi-javadoc/src/test/resources/results/app98.json index 1092d488d..bd342c896 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app98.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app98.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/persons": { "get": { "tags": [ "hello-controller" ], + "summary": "Persons.", "description": "Persons.", "operationId": "persons", "responses": { diff --git a/springdoc-openapi-javadoc/src/test/resources/results/app99.json b/springdoc-openapi-javadoc/src/test/resources/results/app99.json index bb302937c..94d5a9485 100644 --- a/springdoc-openapi-javadoc/src/test/resources/results/app99.json +++ b/springdoc-openapi-javadoc/src/test/resources/results/app99.json @@ -10,12 +10,19 @@ "description": "Generated server url" } ], + "tags": [ + { + "name": "hello-controller", + "description": "The type Hello controller." + } + ], "paths": { "/persons": { "get": { "tags": [ "hello-controller" ], + "summary": "Persons.", "description": "Persons.", "operationId": "persons", "responses": {