Annotation Interface RestResource


@Target({FIELD,METHOD,TYPE}) @Retention(RUNTIME) @Inherited public @interface RestResource
Annotate a Repository with this to influence how it is exported and what the value of the rel attribute will be in links.

As of Spring Data REST 2.0, prefer using RepositoryRestResource to also be able to customize the relation type and description for the item resources exposed by the repository.

Author:
Jon Brisbin, Oliver Gierke
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The description of the collection resource.
    boolean
    Flag indicating whether this resource is exported at all.
    The path segment under which this resource is to be exported.
    The rel value to use when generating links to this resource.
  • Element Details

    • exported

      boolean exported
      Flag indicating whether this resource is exported at all.
      Returns:
      true if the resource is to be exported, false otherwise.
      Default:
      true
    • path

      String path
      The path segment under which this resource is to be exported.
      Returns:
      A valid path segment.
      Default:
      ""
    • rel

      String rel
      The rel value to use when generating links to this resource.
      Returns:
      A valid rel value.
      Default:
      ""
    • description

      Description description
      The description of the collection resource.
      Returns:
      Default:
      @org.springframework.data.rest.core.annotation.Description("")