File tree Expand file tree Collapse file tree
json-schema-validator/src/main/java/io/openapiprocessor/jsonschema/schema Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,11 +25,19 @@ public class SchemaStore {
2525
2626 private final Map <URI , JsonSchema > schemaCache = new HashMap <> ();
2727
28+ private final Settings settings ;
2829 private final DocumentStore documents ;
2930 private final DocumentLoader loader ;
3031
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 ();
3341 this .loader = loader ;
3442 }
3543
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