-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test to check (openapi) block handling during backend refinement
- Loading branch information
Marcel Ludwig
committed
Dec 15, 2020
1 parent
84cce77
commit 4329df5
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
server "protected" { | ||
error_file = "./../server_error.html" | ||
|
||
api { | ||
error_file = "./../api_error.json" | ||
|
||
backend "anything" { # overrides definitions: backend "anything" | ||
path = "/set/by/api/unset/by/endpoint" | ||
openapi { | ||
file = "also-not-there.yml" | ||
} | ||
} | ||
|
||
endpoint "/" { | ||
path = "/set/by/endpoint/unset/by/backend" | ||
backend "anything" { | ||
path = "/anything" | ||
origin = "http://${req.path_params.origin}" | ||
hostname = req.path_params.hostname | ||
set_response_headers = { | ||
x-origin = req.path_params.origin | ||
} | ||
openapi { | ||
file = "08_schema.yaml" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
definitions { | ||
# backend origin within a definition block gets replaced with the integration test "anything" server. | ||
backend "anything" { | ||
path = "/not-found-anything" | ||
origin = "http://anyserver/" | ||
openapi { | ||
file = "not-there.yml" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
openapi: '3' | ||
info: | ||
title: 'Couper backend validation test' | ||
version: 'v1.2.3' | ||
paths: | ||
/anything: | ||
get: | ||
parameters: | ||
- in: query | ||
name: myparam | ||
schema: | ||
type: string | ||
required: true | ||
responses: | ||
200: | ||
description: OK |