Annotation Interface ApiController


@Target(TYPE) @Retention(RUNTIME) @Documented public @interface ApiController
Class annotation that indicates that the class contains endpoints. An endpoint is indicated by the ApiEndpoint annotation on a method. The title and desc parameters should be populated as this data is consumed by the openApi integration within kOS to make the endpoints discoverable.

A base url can optionally be specified in the @ApiController annotation. This will be prefixed to every endpoint defined within the controller. For example, to prefix all mappings with "/myService", use @ApiController(base = "/myService").

Endpoints support versioning via the @{code version} parameter. This will define the default version of all @ApiEndpoint's in the controller class unless they override the version independently. The version will be returned as part of the standard kOS response envelope.

Since:
1.0
Version:
2023-02-09
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Base path for mappings.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Description of the controller for OpenApi docs.
    Title of the controller for OpenApi docs.
    The default api version.
  • Element Details

    • base

      String base
      Base path for mappings.
    • title

      String title
      Title of the controller for OpenApi docs.
      Default:
      ""
    • desc

      String desc
      Description of the controller for OpenApi docs.
      Default:
      ""
    • version

      String version
      The default api version.
      Default:
      ""