forked from networknt/json-schema-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preserve
#
suffix during metaschema URI normalization (networknt#519)
* Add test reproducing issue networknt#518 * fixes networknt#518 add flag for preserving '#' during metaschema URI normalisation
- Loading branch information
Showing
5 changed files
with
100 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.networknt.schema; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.InputStream; | ||
|
||
public class Issue518Test { | ||
private static final JsonMetaSchema igluMetaSchema = | ||
JsonMetaSchema | ||
.builder("http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#", JsonMetaSchema.getV7()) | ||
.build(); | ||
|
||
private static final JsonSchemaFactory FACTORY = | ||
JsonSchemaFactory | ||
.builder(JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V7)) | ||
.addMetaSchema(igluMetaSchema) | ||
.forceHttps(false) | ||
.removeEmptyFragmentSuffix(false) | ||
.build(); | ||
|
||
@Test | ||
public void testPreservingEmptyFragmentSuffix() { | ||
String schemaPath = "/schema/issue518-v7.json"; | ||
InputStream schemaInputStream = getClass().getResourceAsStream(schemaPath); | ||
JsonSchema schema = FACTORY.getSchema(schemaInputStream); | ||
|
||
Assertions.assertNotNull(schema); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#", | ||
"type": "object" | ||
} |