Annotation Type ApiModel


  • @Target(TYPE)
    @Retention(RUNTIME)
    @Inherited
    public @interface ApiModel
    Provides additional information about Swagger models.

    Classes will be introspected automatically as they are used as types in operations, but you may want to manipulate the structure of the models.

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String description
      Provide a longer description of the class.
      String discriminator
      Supports model inheritance and polymorphism.
      Class<?> parent
      Provide a superclass for the model to allow describing inheritance.
      String reference
      Specifies a reference to the corresponding type definition, overrides any other metadata specified
      Class<?>[] subTypes
      An array of the sub types inheriting from this model.
      String value
      Provide an alternative name for the model.
    • Element Detail

      • value

        String value
        Provide an alternative name for the model.

        By default, the class name is used.

        Default:
        ""
      • description

        String description
        Provide a longer description of the class.
        Default:
        ""
      • parent

        Class<?> parent
        Provide a superclass for the model to allow describing inheritance.
        Default:
        java.lang.Void.class
      • discriminator

        String discriminator
        Supports model inheritance and polymorphism.

        This is the name of the field used as a discriminator. Based on this field, it would be possible to assert which sub type needs to be used.

        Default:
        ""
      • subTypes

        Class<?>[] subTypes
        An array of the sub types inheriting from this model.
        Default:
        {}
      • reference

        String reference
        Specifies a reference to the corresponding type definition, overrides any other metadata specified
        Default:
        ""