Skip to content

Commit e0e3c88

Browse files
Updated structure and text to be more descriptive.
Uniform code block style.
1 parent f4b5908 commit e0e3c88

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

doc/config.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Most of the configuration flags are used to control the difference between Swagg
1313
When you create a JsonSchema instance from the JsonSchemaFactory, you can pass an object of SchemaValidatorsConfig as the second parameter.
1414

1515
```
16-
SchemaValidatorsConfig config = new SchemaValidatorsConfig();
17-
config.setTypeLoose(false);
18-
JsonSchema jsonSchema = JsonSchemaFactory.getInstance().getSchema(schema, config);
16+
SchemaValidatorsConfig config = new SchemaValidatorsConfig();
17+
config.setTypeLoose(false);
18+
JsonSchema jsonSchema = JsonSchemaFactory.getInstance().getSchema(schema, config);
1919
```
2020

2121
#### Configurations

doc/ecma-262.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ If you want to ensure full compliance, use the org.jruby.joni. It is 1.5 times s
1313
Here is the test case that shows how to pass a config object to use the ECMA-262 library.
1414

1515
```
16-
@Test(expected = JsonSchemaException.class)
17-
public void testInvalidPatternPropertiesValidatorECMA262() throws Exception {
18-
SchemaValidatorsConfig config = new SchemaValidatorsConfig();
19-
config.setEcma262Validator(true);
20-
JsonSchemaFactory factory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V4);
21-
JsonSchema schema = factory.getSchema("{\"patternProperties\":6}", config);
22-
23-
JsonNode node = getJsonNodeFromStringContent("");
24-
Set<ValidationMessage> errors = schema.validate(node);
25-
Assert.assertEquals(errors.size(), 0);
26-
}
16+
@Test(expected = JsonSchemaException.class)
17+
public void testInvalidPatternPropertiesValidatorECMA262() throws Exception {
18+
SchemaValidatorsConfig config = new SchemaValidatorsConfig();
19+
config.setEcma262Validator(true);
20+
JsonSchemaFactory factory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V4);
21+
JsonSchema schema = factory.getSchema("{\"patternProperties\":6}", config);
22+
23+
JsonNode node = getJsonNodeFromStringContent("");
24+
Set<ValidationMessage> errors = schema.validate(node);
25+
Assert.assertEquals(errors.size(), 0);
26+
}
2727
```
2828

2929

doc/yaml.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ One of the features of this library is to validate the YAML file in addition to
55
Add the dependency
66

77
```
8-
<dependency>
9-
<groupId>com.fasterxml.jackson.dataformat</groupId>
10-
<artifactId>jackson-dataformat-yaml</artifactId>
11-
<version>2.10.1</version>
12-
</dependency>
8+
<dependency>
9+
<groupId>com.fasterxml.jackson.dataformat</groupId>
10+
<artifactId>jackson-dataformat-yaml</artifactId>
11+
<version>2.10.1</version>
12+
</dependency>
1313
```
1414

1515
and create object mapper using yaml factory i.e `ObjectMapper objMapper =new ObjectMapper(new YAMLFactory());`
1616

1717
#### Example
1818
```
1919
JsonSchemaFactory factory = JsonSchemaFactory.builder(JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V7)).objectMapper(mapper).build(); /* Using draft-07. You can choose anyother draft.*/
20-
JsonSchema schema = factory.getSchema(YamlOperations.class.getClassLoader().getResourceAsStream("your-schema.json"));
20+
JsonSchema schema = factory.getSchema(YamlOperations.class.getClassLoader().getResourceAsStream("your-schema.json"));
2121
22-
JsonNode jsonNode = mapper.readTree(YamlOperations.class.getClassLoader().getResourceAsStream("your-file.yaml"));
23-
Set<ValidationMessage> validateMsg = schema.validate(jsonNode);
22+
JsonNode jsonNode = mapper.readTree(YamlOperations.class.getClassLoader().getResourceAsStream("your-file.yaml"));
23+
Set<ValidationMessage> validateMsg = schema.validate(jsonNode);
2424
```
2525

0 commit comments

Comments
 (0)