byoutline / MockServer

Simple REST server that makes simulating API easy.
Apache License 2.0
30 stars 4 forks source link

Variables in config #3

Closed smdremedy closed 8 years ago

smdremedy commented 9 years ago

Paths, queries and headers should allow using simple variables e.g. in main config: "auth" = "auth-token-12345"

in request
{
  "headers" : {
     "Auth-Token" : "${auth}"
  }
}
Naitbit commented 8 years ago

Can we use similar mechanism to "response file" instead? We would not have a variable, but we would have file that could be reused in multiple requests. Additionally we could override/attach content of the file using old "headers" syntax like this:

"headers file": "commonHeaders.json"
"headers" : {
     "Auth-Token" : "auth-token-12345"
  }

This syntax could be also added for "queries" as "queries file".

Naitbit commented 8 years ago

For now I've added support for "headers file" and "queries file". ( 568768701a3121abf2afb55041f5f0b68101a2ac ). If it is not sufficient please reopen this issue.

Naitbit commented 8 years ago

Available for testing in 2.0.0-SNAPSHOT