You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not possible to name a variable prefixing an *underscore* (`_`). So, `_Name` is an invalid name. Variable names can include `A-Z, a-z, 0-9, ., -, _`.
32
+
::::tip [Naming variables]
33
+
34
+
Variable names can include
35
+
36
+
-`A-Z`
37
+
-`a-z`
38
+
-`0-9`
39
+
-`.` dot
40
+
-`-` dash
41
+
-`_` underscore
34
42
35
-
### Passing variables from console
43
+
:::warning
36
44
37
-
It's possible to pass variables from console while invoking `chk` command. e.g:
45
+
It is not possible to start a variable name with _underscore_ (`_`). Therefore, `_Name` is an invalid name, when `Name_` is valid.
38
46
39
-
So, for following HTTP specification:
47
+
:::
40
48
41
-
```yml [title="request-someurl.chk"]
49
+
::::
50
+
51
+
## Passing variables from console
52
+
53
+
It's possible to pass variables from console while invoking `chk` command. Let's have following HTTP specification:
Then CHKware will replace `<% emailAddr %>` with `"user@domain.ext"`, before making request. When variable not passed from console, `<% emailAddr %>` will be replaced with `null`.
60
74
61
-
###Setting default value
75
+
## Setting default value
62
76
63
77
It's possible to set a default value for a variable. Consider following example:
Then CHKware will replace `<% emailAddr %>` with `"user@domain.ext"`, before making request.
86
100
87
-
However, if invoked like:
101
+
However, if invoked in the console like:
88
102
89
103
```shell
90
104
chk fetch request-someurl.chk
91
105
```
92
106
93
-
Then CHKware will replace `<% emailAddr %>` with something like `"user-2@domain.ext"` (or with an email of randomly picked number).
107
+
Then CHKware will replace `<% emailAddr %>` with something like `"user-2@domain.ext"` (or with an email of randomly picked number) since we set default value to `user-<% range(1, 5) | random %>@domain.ext`.
94
108
95
-
###Variable templating with Jinja2
109
+
## Variable templating with Jinja2
96
110
97
-
For variable templating *CHKware* uses Jinja2. Almost all of the [Jinja2 features](https://jinja.palletsprojects.com/en/stable/templates/) are supported. That makes it possible to change variables values. e.g:
111
+
For variable templating _CHKware_ uses Jinja2. Almost all of the [Jinja2 features](https://jinja.palletsprojects.com/en/stable/templates/) are supported. That makes it possible to change variables values. e.g:
Copy file name to clipboardExpand all lines: docs/references/version.md
+3-8Lines changed: 3 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,7 @@
1
1
---
2
2
title: Document version
3
3
---
4
-
5
-
### Introduction
6
-
7
-
Each `.chk`, `.yaml` or `.yml` files containing *CHKware* YAML-dsl is a spec. or specification file. Each of these file **MUST** contain a YAML node called *version:*. E.g:
4
+
Each `.chk`, `.yaml` or `.yml`[specification files](./console-command#specification-files) or spec contains *CHKware* YAML-dsl. Each of these file **MUST** contain a YAML node called *version:*. E.g:
8
5
9
6
```yml
10
7
version: default:http:0.7.2
@@ -15,11 +12,9 @@ The version string contains a document version. Document version show which vers
15
12
16
13
The `chk` tool will exit with an error when unsupported document version found.
17
14
18
-
It's encouraged for user to write document version on the very top of a spec. document, so that it's clearly visible. However it can be written as a top-level key on any place of the document.
19
-
20
-
Supported document version can be found on corresponding specification reference.
15
+
Although `version:` can be written as a top-level key on any place of the spec, it's encouraged to write `version:` on the very top, so that it's clearly visible.
21
16
22
-
### Format
17
+
##Document version format
23
18
24
19
This version string have 3 parts: `<plugin>:<module>:<number>`, e.g: `default:http:0.8.0`
Copy file name to clipboardExpand all lines: docs/setup/setup-ext.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,18 @@
2
2
title: Setup VS Code extension
3
3
---
4
4
5
-
:::warning
5
+
::::success[visual studio code extension download]
6
6
7
-
[CHKware vscode extension](https://marketplace.visualstudio.com/items?itemName=chkware.chkware) on visual studio marketplace it not updated.
7
+
Latest vscode extension can be found on project's Github [release page](https://github.com/chkware/vscode-ext/releases). ✅
8
8
9
-
:::
10
-
:::success
9
+
:::warning[deprecated]
11
10
12
-
Latest vscode extension can be found on project's Github [release page](https://github.com/chkware/vscode-ext/releases).
11
+
[CHKware vscode extension](https://marketplace.visualstudio.com/items?itemName=chkware.chkware) on visual studio marketplace is deprecated, and not updated to latest spec documents. ⛔️
13
12
14
13
:::
15
14
15
+
::::
16
+
16
17
*CHKware VS Code extension* helps to write `.chk` files quick. It contains regular used snippets those makes test spec. development quick.
17
18
18
19
### Install *CHKware* extension for Visual Studio Code
0 commit comments