Annotation Type ApiRoot


@Target(TYPE) @Retention(RUNTIME) public @interface ApiRoot
Defines the Root of a particular category. If this is not defined the default model for the category will be used.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The Sling path to use when creating this resource.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    If paths in the content tree need to changed as they go into the API space implement a ModelPathMapper the converts between the new URL spaces.
  • Element Details

    • baseResource

      String baseResource
      The Sling path to use when creating this resource. This will allow the API framework to inject the correct resource when rendering the Root API response, e.g. /api/category.json
      Returns:
      the base resource path
    • pathMapper

      Class<? extends ModelPathMapper> pathMapper
      If paths in the content tree need to changed as they go into the API space implement a ModelPathMapper the converts between the new URL spaces. This allows a developer to have total control over all the paths generated by the API endpoint. Be careful when doing this as it would be easy to create incorrect URLs.
      Returns:
      class that will manage the URL mappings
      Default:
      com.adobe.granite.haf.apiroot.impl.EchoMapper.class