dekorate
dekorate copied to clipboard
Service not generated in yaml when @RestController contains only inherited @RequestMapping's
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.
@RestController alone, should suffice. So, I'll have to check if its a bug. Till then you can define a web port manually.