Skip to content

Commit abc28af

Browse files
committed
Add the as_text key to doc
1 parent d4d0b95 commit abc28af

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doc/files/JSON-CONFIG-FILE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The main class of this plugin. This class would read the user input file, detect
44

55
## Usage
66

7-
First, once you have instantiated the 'JSONConfigFile' class, you can add new properties by using the 'add_property' method, which requires the property name and a JSONProperty object as its parameters. By default, any new property is obligatory. If you want to make it optional, you must include 'false' as the third parameter. The fourth parameter is the default value that the property would take if the input does not specify this property. Any default value must pass the tests of this property. Otherwise, it would not be accepted.
7+
First, once you have instantiated the 'JSONConfigFile' class, you can add new properties by using the 'add_property' method, which requires the property name and a 'JSONProperty' object as its parameters. By default, any new property is obligatory. If you want to make it optional, you must include 'false' as the third parameter. The fourth parameter is the default value that the property would take if the input does not specify this property. Any default value must pass the tests of this property. Otherwise, it would not be accepted.
88

99
After adding all the properties, you can create exclusivity and dependency relationships between them. You can not establish these relations with obligatory properties, so every property must be optional.
1010

@@ -22,6 +22,8 @@ It is important to note that the validation process represents any error or warn
2222

2323
- **The 'context' key:** The name of the field that contains this error/warning.
2424

25+
- **The 'as_text' key:** The default error message, usefull if you do not want to implement your own error messages.
26+
2527
In other words, the errors/warnings are dictionaries that allow the creation of custom error messages, as this plugin aims to provide information to a user of the final application. Finally, the method 'get_result' returns the resultant dictionary from reading the file.
2628

2729
## Example: Adding two properties

0 commit comments

Comments
 (0)