Annotation Interface Schema


@Retention(RUNTIME) @Target({METHOD,TYPE}) public @interface Schema
Specify a schema for the element that is being described.

This annotation can also be used to specify an id for a schema defined by a type.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The type to produce the schema from.
    The schema identifier.
    A classpath resource that contains a JSON Schema structure to be used.
  • Element Details

    • id

      String id
      The schema identifier. If provided, this schema will be added to definitions and referenced from anywhere it is used. If null/empty, the schema will be used inline.
      Default:
      ""
    • fromType

      Class<?> fromType
      The type to produce the schema from.
      Default:
      java.lang.Void.class
    • schemaResource

      String schemaResource
      A classpath resource that contains a JSON Schema structure to be used. The path is relative to the type that the annotated resource method is part of, and will be resolved using the Class.getResourceAsStream(String) method on that class instance.
      Default:
      ""