Package eu.cloudhopper.mc.annotations
Annotation Interface HttpTrigger
Declares that a function should be exposed via an HTTP endpoint.
This annotation provides HTTP metadata such as method, path, summary, and operation ID, which can be used by code generators to configure API gateways or HTTP routing (e.g., AWS API Gateway, GCP Cloud Functions, Azure HTTP Triggers).
It is typically used in combination with Function
to describe the HTTP-facing contract of a function.
Example
@Function(name = "hello")
@HttpTrigger(
method = "GET",
path = "/hello/{name}",
summary = "Says hello",
description = "Returns a greeting using the given name",
operationId = "sayHello"
)
public String handleRequest(@PathParam("name") String name) {
return "Hello, " + name + "!";
}
Code generators may use this information to:
- Generate OpenAPI documentation
- Configure routing rules in serverless platforms
- Generate client SDKs
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConstants representing attribute names ofHttpTrigger. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionA longer, detailed description of the operation.The HTTP method to use (e.g.,"GET","POST").A unique identifier for the operation.The HTTP path to which the function is bound (e.g.,"/hello/{name}").A short summary of the operation.
-
Element Details
-
summary
String summaryA short summary of the operation.Typically used in generated documentation.
- Returns:
- summary string
- Default:
""
-
description
String descriptionA longer, detailed description of the operation.Useful for API documentation or developer portals.
- Returns:
- description string
- Default:
""
-
operationId
String operationIdA unique identifier for the operation.This may be used for client SDK generation or route mapping.
- Returns:
- operation ID
- Default:
""
-
path
String pathThe HTTP path to which the function is bound (e.g.,"/hello/{name}").Supports path parameters enclosed in braces.
- Returns:
- endpoint path
- Default:
""
-
method
String methodThe HTTP method to use (e.g.,"GET","POST").- Returns:
- HTTP method
- Default:
""
-