dekorate icon indicating copy to clipboard operation
dekorate copied to clipboard

Service not generated in yaml when @RestController contains only inherited @RequestMapping's

Open nvp152 opened this issue 4 years ago • 1 comments

If a class annotated with @RestController has no direct RequestMappings but instead inherits them from an interface, the kubernetes service is not generated in the yaml.

The root cause is probably that the implementation works with java annotation processing which will honor this behavior, if and only if, the annotation is itself marked as inherited. However, as indicated here, the absence of inherited does not mean that it cannot be. This is definitely the case of @RequestMapping (see https://github.com/spring-projects/spring-framework/issues/8859).

This can probably be fixed by leveraging spring's annotation processing utilities and AnnotationUtils.findAnnotation in particular.

nvp152 avatar Sep 04 '20 07:09 nvp152

@RestController alone, should suffice. So, I'll have to check if its a bug. Till then you can define a web port manually.

iocanel avatar Sep 04 '20 11:09 iocanel