Closed rafaeljesus closed 6 years ago
The API should validate empty upstreams target field
Reproduction Steps:
/apis
Expected behavior: API should run validations for upstreams field
When I send POST /apis With proxy definition
{ "name": "test", "proxy": { "listen_path": "/example/*" } }
Then API shoukd respond 400 And response json contains error: "proxy.upstreams field is required"
400
error: "proxy.upstreams field is required"
{ "name": "test", "proxy": { "listen_path": "/example/*", "upstreams": { "target": "" } } }
Then API shoukd respond 400 And response json contains error: "proxy.upstreams.target field is required"
error: "proxy.upstreams.target field is required"
{ "name": "test", "proxy": { "listen_path": "/example/*", "upstreams": { "target": "foo.io" } } }
Then API shoukd respond 400 And response json contains error: "proxy.upstreams.target field is invalid"
error: "proxy.upstreams.target field is invalid"
Janus version: latest OS and version: [Mac Sierra 10.12.6]
The API should validate empty upstreams target field
Reproduction Steps:
/apis
to create a new proxy definition, where the json doesn't contains upstreams attributeExpected behavior: API should run validations for upstreams field
Validation 1
When I send POST
/apis
With proxy definitionThen API shoukd respond
400
And response json containserror: "proxy.upstreams field is required"
Validation 2
When I send POST
/apis
With proxy definitionThen API shoukd respond
400
And response json containserror: "proxy.upstreams.target field is required"
Validation 3
When I send POST
/apis
With proxy definitionThen API shoukd respond
400
And response json containserror: "proxy.upstreams.target field is invalid"
Janus version: latest OS and version: [Mac Sierra 10.12.6]