Annotation Interface Extension


@Repeatable(Extensions.class) @Retention(SOURCE) public @interface Extension
Declares a vendor-specific or custom extension attribute for a Function.

This annotation can be used to specify additional deployment metadata that is not covered by the standard Function attributes. Predefined keys are available as constants in ExtensionKeys, for example ExtensionKeys.Aws.Architecture.KEY ("x-aws-architecture").

This annotation is repeatable via the Extensions container annotation and is only retained in source code for processing during code generation.

Example usage:


 @Function(
     name = "hello",
     extensions = {
         @Extension(
             name = ExtensionKeys.Aws.Architecture.KEY,
             value = ExtensionKeys.Aws.Architecture.Values.ARM64)
     }
 )
 
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The name of the extension attribute.
    The value associated with the extension attribute.
  • Element Details

    • name

      String name
      The name of the extension attribute.

      Vendor-specific keys follow the OpenAPI x- prefix convention, e.g. "x-aws-architecture". Prefer the constants in ExtensionKeys over string literals where one exists.

      Returns:
      the attribute name
    • value

      String value
      The value associated with the extension attribute.

      Interpretation depends on the attribute name, e.g. "arm64" for ExtensionKeys.Aws.Architecture.KEY.

      Returns:
      the attribute value