This adds support for verifying that snippets with the `console-result` language are valid json. It also switches the response snippets on the `docs/get` page from `js` to `console-result` which will allow clients to provide "alternatives" for them like they can now do with `// CONSOLE` snippets.
This commit is contained in:
parent
3d64605075
commit
b3f76d6f22
|
@ -123,7 +123,7 @@ public class SnippetsTask extends DefaultTask {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (snippet.testResponse
|
if (snippet.testResponse
|
||||||
&& 'js' == snippet.language
|
&& ('js' == snippet.language || 'console-result' == snippet.language)
|
||||||
&& null == snippet.skip) {
|
&& null == snippet.skip) {
|
||||||
String quoted = snippet.contents
|
String quoted = snippet.contents
|
||||||
// quote values starting with $
|
// quote values starting with $
|
||||||
|
@ -162,7 +162,7 @@ public class SnippetsTask extends DefaultTask {
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
matcher = line =~ /\["?source"?,\s*"?(\w+)"?(,.*)?].*/
|
matcher = line =~ /\["?source"?,\s*"?([-\w]+)"?(,.*)?].*/
|
||||||
if (matcher.matches()) {
|
if (matcher.matches()) {
|
||||||
lastLanguage = matcher.group(1)
|
lastLanguage = matcher.group(1)
|
||||||
lastLanguageLine = lineNumber
|
lastLanguageLine = lineNumber
|
||||||
|
|
|
@ -240,7 +240,7 @@ GET twitter/_doc/0
|
||||||
|
|
||||||
The API returns the following result:
|
The API returns the following result:
|
||||||
|
|
||||||
[source,js]
|
[source,console-result]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
{
|
{
|
||||||
"_index" : "twitter",
|
"_index" : "twitter",
|
||||||
|
@ -359,7 +359,7 @@ GET twitter/_doc/1?stored_fields=tags,counter
|
||||||
|
|
||||||
The API returns the following result:
|
The API returns the following result:
|
||||||
|
|
||||||
[source,js]
|
[source,console-result]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
{
|
{
|
||||||
"_index": "twitter",
|
"_index": "twitter",
|
||||||
|
@ -403,7 +403,7 @@ GET twitter/_doc/2?routing=user1&stored_fields=tags,counter
|
||||||
|
|
||||||
The API returns the following result:
|
The API returns the following result:
|
||||||
|
|
||||||
[source,js]
|
[source,console-result]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
{
|
{
|
||||||
"_index": "twitter",
|
"_index": "twitter",
|
||||||
|
|
Loading…
Reference in New Issue