Class OpenApiCustomizer

java.lang.Object
org.vrspace.server.config.OpenApiCustomizer
All Implemented Interfaces:
org.springdoc.core.customizers.GlobalOperationCustomizer, org.springdoc.core.customizers.OperationCustomizer

@Component public class OpenApiCustomizer extends Object implements org.springdoc.core.customizers.GlobalOperationCustomizer
Disables uniqueness of auto-generated OpenApi operation id, by enforcing name from either Operation annotation, or from method name. In the spec, operationId must be unique, so SpringDoc by default generates operations like list, list_2, list_3 etc, for every method of every controller that is named list. Generated REST client than gets list2() etc method. This forces either 1) server-wide unique REST controller method names or 2) use swagger Operation annotation to designate generated client method name. Otherwise, mvn generate-sources -P openapi fails to validate the spec. https://github.com/springdoc/springdoc-openapi/issues/2646
Author:
joe
  • Constructor Details

    • OpenApiCustomizer

      public OpenApiCustomizer()
  • Method Details

    • customize

      public io.swagger.v3.oas.models.Operation customize(io.swagger.v3.oas.models.Operation operation, org.springframework.web.method.HandlerMethod handlerMethod)
      Specified by:
      customize in interface org.springdoc.core.customizers.OperationCustomizer