github.com/avenga/couper@v1.12.2/server/testdata/integration/error_handler/07_couper.hcl (about)

     1  server {
     2    api {
     3      endpoint "/" {
     4        request {
     5          url = "http://localhost:8080/i"
     6          backend = "be"
     7          expected_status = [200]
     8        }
     9  
    10        error_handler "unexpected_status" {
    11          response {
    12            status = 417
    13            json_body = {
    14              handled_by = "unexpected_status"
    15            }
    16          }
    17        }
    18  
    19        error_handler "backend_openapi_validation" {
    20          response {
    21            status = 418
    22            json_body = {
    23              handled_by = "backend_openapi_validation"
    24            }
    25          }
    26        }
    27      }
    28  
    29      endpoint "/i" {
    30        response {
    31          body = "OK"
    32        }
    33      }
    34    }
    35  }
    36  
    37  definitions {
    38    backend "be" {
    39      openapi {
    40        file = "03_schema.yaml"
    41      }
    42    }
    43  }