File tree Expand file tree Collapse file tree 2 files changed +46
-2
lines changed
json-schema-validator/src/main/java/io/openapiprocessor/jsonschema/schema Expand file tree Collapse file tree 2 files changed +46
-2
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,19 @@ public class SchemaStore {
25
25
26
26
private final Map <URI , JsonSchema > schemaCache = new HashMap <> ();
27
27
28
+ private final Settings settings ;
28
29
private final DocumentStore documents ;
29
30
private final DocumentLoader loader ;
30
31
31
- public SchemaStore (DocumentLoader loader ) {
32
- this .documents = new DocumentStore ();
32
+ public SchemaStore (DocumentLoader loader ) {
33
+ this .settings = new Settings ().version (SchemaVersion .getLatest ());
34
+ this .documents = new DocumentStore ();
35
+ this .loader = loader ;
36
+ }
37
+
38
+ public SchemaStore (DocumentLoader loader , Settings settings ) {
39
+ this .settings = settings ;
40
+ this .documents = new DocumentStore ();
33
41
this .loader = loader ;
34
42
}
35
43
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2024 https://github.com/openapi-processor/openapi-parser
3
+ * PDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ package io .openapiprocessor .jsonschema .schema ;
7
+
8
+ import org .checkerframework .checker .nullness .qual .Nullable ;
9
+
10
+ public class Settings {
11
+ private @ Nullable SchemaVersion version ;
12
+ private boolean loadSchemas ;
13
+
14
+ public Settings () {
15
+ version = null ;
16
+ loadSchemas = false ;
17
+ }
18
+
19
+ public Settings version (SchemaVersion version ) {
20
+ this .version = version ;
21
+ return this ;
22
+ }
23
+
24
+ public Settings loadSchemas (boolean load ) {
25
+ this .loadSchemas = load ;
26
+ return this ;
27
+ }
28
+
29
+ public @ Nullable SchemaVersion getVersion () {
30
+ return version ;
31
+ }
32
+
33
+ public boolean isLoadSchemas () {
34
+ return loadSchemas ;
35
+ }
36
+ }
You can’t perform that action at this time.
0 commit comments