1818
1919/**
2020 * A repository is a holder of dereferenced schemas, it can be used to create validator instances for a specific schema.
21- *
21+ * <p>
2222 * This is to be used when multiple schema objects compose the global schema to be used for validation.
2323 *
2424 * @author Paulo Lopes
@@ -28,6 +28,7 @@ public interface SchemaRepository {
2828
2929 /**
3030 * Create a repository with some initial configuration.
31+ *
3132 * @param options the initial configuration
3233 * @return a repository
3334 */
@@ -39,27 +40,39 @@ static SchemaRepository create(JsonSchemaOptions options) {
3940 * Dereferences a schema to the repository.
4041 *
4142 * @param schema a new schema to list
42- * @throws SchemaException when a schema is already present for the same id
4343 * @return a repository
44+ * @throws SchemaException when a schema is already present for the same id
4445 */
4546 @ Fluent
4647 SchemaRepository dereference (JsonSchema schema ) throws SchemaException ;
4748
4849 /**
4950 * Dereferences a schema to the repository.
5051 *
51- * @param uri the source of the schema used for de-referencing, optionally relative to
52- * {@link JsonSchemaOptions#getBaseUri()}.
52+ * @param uri the source of the schema used for de-referencing, optionally relative to
53+ * {@link JsonSchemaOptions#getBaseUri()}.
5354 * @param schema a new schema to list
54- * @throws SchemaException when a schema is already present for the same id
5555 * @return a repository
56+ * @throws SchemaException when a schema is already present for the same id
5657 */
5758 @ Fluent
5859 SchemaRepository dereference (String uri , JsonSchema schema ) throws SchemaException ;
5960
6061 /**
61- * Preloads the repository with the meta schemas for the related draft version.
62+ * Preloads the repository with the meta schemas for the related @link {@link Draft} version. The related draft version
63+ * is determined from the {@link JsonSchemaOptions}, in case that no draft is set in the options an
64+ * {@link IllegalStateException} is thrown.
65+ *
6266 * @param fs The Vert.x file system to load the related schema meta files from classpath
67+ * @return a repository
68+ */
69+ @ Fluent
70+ SchemaRepository preloadMetaSchema (FileSystem fs );
71+
72+ /**
73+ * Preloads the repository with the meta schemas for the related draft version.
74+ *
75+ * @param fs The Vert.x file system to load the related schema meta files from classpath
6376 * @param draft The draft version of the meta files to load
6477 * @return a repository
6578 */
@@ -85,7 +98,7 @@ static SchemaRepository create(JsonSchemaOptions options) {
8598 /**
8699 * A new validator instance overriding this repository options.
87100 *
88- * @param schema the start validation schema
101+ * @param schema the start validation schema
89102 * @param options the options to be using on the validator instance
90103 * @return the validator
91104 */
@@ -94,15 +107,15 @@ static SchemaRepository create(JsonSchemaOptions options) {
94107 /**
95108 * A new validator instance overriding this repository options.
96109 *
97- * @param ref the start validation reference in JSON pointer format
110+ * @param ref the start validation reference in JSON pointer format
98111 * @param options the options to be using on the validator instance
99112 * @return the validator
100113 */
101114 Validator validator (String ref , JsonSchemaOptions options );
102115
103116 /**
104117 * Tries to resolve all internal and repository local references. External references are not resolved.
105- *
118+ * <p>
106119 * The result is an object where all references have been resolved. Resolution of references is shallow. This
107120 * should normally not be a problem for this use case.
108121 *
@@ -113,7 +126,7 @@ static SchemaRepository create(JsonSchemaOptions options) {
113126
114127 /**
115128 * Tries to resolve all internal and repository local references. External references are not resolved.
116- *
129+ * <p>
117130 * The result is an object where all references have been resolved. Resolution of references is shallow. This
118131 * should normally not be a problem for this use case.
119132 *
@@ -125,6 +138,7 @@ static SchemaRepository create(JsonSchemaOptions options) {
125138
126139 /**
127140 * Look up a schema using a JSON pointer notation
141+ *
128142 * @param pointer the JSON pointer
129143 * @return the schema
130144 */
0 commit comments