Enum ReferenceType

java.lang.Object
java.lang.Enum<ReferenceType>
io.smallrye.openapi.model.ReferenceType
All Implemented Interfaces:
Serializable, Comparable<ReferenceType>

public enum ReferenceType extends Enum<ReferenceType>
Simple enum to indicate the type of a $ref being read/written.
Author:
eric.wittmann@gmail.com
  • Enum Constant Details

  • Field Details

  • Method Details

    • values

      public static ReferenceType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ReferenceType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • fromModel

      public static ReferenceType fromModel(org.eclipse.microprofile.openapi.models.Reference<?> model)
    • fromComponentPath

      public static ReferenceType fromComponentPath(String path)
    • isReference

      public static boolean isReference(org.jboss.jandex.AnnotationInstance annotation)
    • referenceValue

      public static String referenceValue(org.jboss.jandex.AnnotationInstance annotation)
    • referencePrefix

      public String referencePrefix()
    • referenceOf

      public String referenceOf(String ref)
    • parseRefValue

      public String parseRefValue(String ref)
      Takes the value from a ref property from an annotation, and converts it to a JSON Pointer, suitable for use as a reference in an OpenAPI model.
      Parameters:
      ref - the ref value read from an annotation
      Returns:
      a value suitable for use in an OpenAPI model.
    • refValue

      public String refValue(org.jboss.jandex.AnnotationInstance annotation)
      Reads a string property named "ref" value from the given annotation and converts it to a value appropriate for setting on a model's "$ref" property.
      Parameters:
      annotation - AnnotationInstance
      Returns:
      String value