Resource (Grails 4.0.11)
Date: 2021-06-24

Package: grails.rest

## [Groovy] Annotation Type Resource

- grails.rest.Resource

- Meta Annotation to applied to a domain class if it is a REST resource

  Authors:
    Graeme Rocher
  Since:
    2.3

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `null` | `java.lang.String[]` | `formats()` @default "json", 'xml'] Returns: The allowed response formats
    `null` | `java.lang.String` | `namespace()` Returns: The namespace of the resource.
    `null` | `boolean` | `readOnly()` @default false Returns: Whether this is a read-only resource (one that doesn't allow DELETE, POST, PUT or PATCH requests)
    `null` | `java.lang.Class<?>` | `superClass()` @default RestfulController Returns: The super class to use for the generated controller class
    `null` | `java.lang.String` | `uri()` Returns: The URI of the resource.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Method Detail

    - #### java.lang.String[] formats()

      Returns:
        The allowed response formats
      Default:
        "json", 'xml']

    - #### java.lang.String namespace()

      Returns:
        The namespace of the resource. If specified a UrlMapping with this namespace will automatically be registered for the resource
      Default:
        ""

    - #### boolean readOnly()

      Returns:
        Whether this is a read-only resource (one that doesn't allow DELETE, POST, PUT or PATCH requests)
      Default:
        false

    - #### java.lang.Class<?> superClass()

      Returns:
        The super class to use for the generated controller class
      Default:
        RestfulController

    - #### java.lang.String uri()

      Returns:
        The URI of the resource. If specified a UrlMapping will automatically be registered for the resource
      Default:
        ""