@@ -16,6 +16,7 @@ fun getFilter(schemaType: SchemaType?): TestFilter =
16
16
when (schemaType ? : SchemaType .entries.last()) {
17
17
SchemaType .DRAFT_7 -> TestFilterDraft7
18
18
SchemaType .DRAFT_2019_09 -> TestFilterDraft201909
19
+ SchemaType .DRAFT_2020_12 -> TestFilterDraft202012
19
20
}
20
21
21
22
object TestFilterDraft7 : TestFilter {
@@ -92,3 +93,42 @@ object TestFilterDraft201909 : TestFilter {
92
93
}
93
94
}
94
95
}
96
+
97
+ object TestFilterDraft202012 : TestFilter {
98
+ /* *
99
+ * All these cases are ignored because they contain remote refs or meta schema
100
+ * Library does not support them yet.
101
+ */
102
+ private val IGNORED_CASES_WITH_REMOTE_REF : Set <String > = hashSetOf(
103
+ " invalid anchors" ,
104
+ " Invalid use of fragments in location-independent \$ id" ,
105
+ " Valid use of empty fragments in location-independent \$ id" ,
106
+ " Unnormalized \$ ids are allowed but discouraged" ,
107
+ " URN base URI with f-component" ,
108
+ " remote HTTP ref with different \$ id" ,
109
+ " remote HTTP ref with different URN \$ id" ,
110
+ " remote HTTP ref with nested absolute ref" ,
111
+ " \$ ref to \$ ref finds detached \$ anchor" ,
112
+ " schema that uses custom metaschema with with no validation vocabulary" ,
113
+ " ignore unrecognized optional vocabulary" ,
114
+ " validate definition against metaschema" ,
115
+ " retrieved nested refs resolve relative to their URI not \$ id" ,
116
+ " base URI change - change folder in subschema" ,
117
+ " base URI change - change folder" ,
118
+ " base URI change" ,
119
+ " strict-tree schema, guards against misspelled properties" ,
120
+ " tests for implementation dynamic anchor and reference link" ,
121
+ " \$ ref and \$ dynamicAnchor are independent of order - \$ defs first" ,
122
+ " \$ ref and \$ dynamicAnchor are independent of order - \$ ref first" ,
123
+ " \$ ref to \$ dynamicRef finds detached \$ dynamicAnchor" ,
124
+ )
125
+
126
+ override fun shouldSkipCase (caseDescription : String ): String? {
127
+ return when {
128
+ caseDescription.endsWith(" format" ) -> " the format keyword is not yet supported"
129
+ caseDescription in IGNORED_CASES_WITH_REMOTE_REF || caseDescription.contains(" remote ref" ) ->
130
+ " remote schema loading and meta schemas are not yet supported"
131
+ else -> null
132
+ }
133
+ }
134
+ }
0 commit comments