Skip to content

Commit 06a6f99

Browse files
committed
Ensure that we're fully backwards compatible
Signed-off-by: Paulo Lopes <[email protected]>
1 parent 43a7786 commit 06a6f99

File tree

12 files changed

+22
-7
lines changed

12 files changed

+22
-7
lines changed

src/main/java/examples/JsonSchemaDslExamples.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package examples;
22

33
import io.vertx.core.json.JsonObject;
4-
import io.vertx.json.schema.Schema;
5-
import io.vertx.json.schema.SchemaParser;
64
import io.vertx.json.schema.common.dsl.SchemaBuilder;
75
import io.vertx.json.schema.common.dsl.SchemaType;
86
import io.vertx.json.schema.draft7.dsl.StringFormat;
@@ -53,7 +51,7 @@ public void alias() {
5351
.requiredProperty("anInteger", refToAlias("myInt"));
5452
}
5553

56-
public void parse(SchemaParser parser) {
54+
public void parse() {
5755
JsonObject schema = objectSchema()
5856
.requiredProperty("name", stringSchema())
5957
.requiredProperty("age", intSchema())

src/main/java/examples/JsonSchemaExamples.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
package examples;
22

3-
import io.vertx.core.Vertx;
43
import io.vertx.core.json.JsonObject;
5-
import io.vertx.core.json.pointer.JsonPointer;
64
import io.vertx.json.schema.*;
75

86
public class JsonSchemaExamples {
97

10-
public void instantiate(Vertx vertx) {
8+
public void instantiate() {
119
SchemaRepository repository =
1210
SchemaRepository.create(new JsonSchemaOptions().setBaseUri("https://vertx.io"));
1311
}
1412

15-
public void parse(SchemaParser parser, JsonObject object, JsonPointer schemaPointer) {
13+
public void parse(JsonObject object, SchemaRepository repository) {
1614
JsonSchema schema = JsonSchema.of(object);
15+
16+
// Or
17+
18+
repository.dereference(JsonSchema.of(object));
1719
}
1820

1921
public void validate(JsonSchema schema, Object json) {

src/main/java/io/vertx/json/schema/NoSyncValidationException.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616
/**
1717
* This exception is thrown when you call {@link Schema#validateSync(Object)} when the schema is in an asynchronous state
18+
* @deprecated users should migrate to the new validator
1819
*/
20+
@Deprecated
1921
public class NoSyncValidationException extends VertxException {
2022

2123
private final MutableStateValidator validator;

src/main/java/io/vertx/json/schema/Schema.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
* To check the schema state you can use method {@link this#isSync()}. Note that invoking {@link #validateAsync(Object)} generally doesn't have any additional overhead than invoking {@link #validateSync(Object)}. <br/>
2727
* The schema can mutate the state in time, e.g. if you have a schema that is asynchronous because of a {@code $ref},
2828
* after the first validation the external schema is cached inside {@link SchemaRouter} and this schema will switch to synchronous state<br/>
29+
* @deprecated users should migrate to the new validator
2930
*/
31+
@Deprecated
3032
@VertxGen
3133
public interface Schema {
3234

src/main/java/io/vertx/json/schema/SchemaParser.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424

2525
/**
2626
* Parse a Json Schema. The parser can be extended to support custom keywords using {@link this#withValidatorFactory(ValidatorFactory)}
27+
* @deprecated users should migrate to the new validator
2728
*/
29+
@Deprecated
2830
@VertxGen
2931
public interface SchemaParser {
3032

src/main/java/io/vertx/json/schema/SchemaRouter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
* You should not share this object between different threads
3636
*
3737
* @author slinkydeveloper
38+
* @deprecated users should migrate to the new validator
3839
*/
40+
@Deprecated
3941
@VertxGen
4042
public interface SchemaRouter {
4143

src/main/java/io/vertx/json/schema/SchemaRouterOptions.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919

2020
/**
2121
* Represents the options to resolve external schemas. You can configure auth options to access to external services
22+
* @deprecated users should migrate to the new validator
2223
*/
24+
@Deprecated
2325
@DataObject(generateConverter = true)
2426
public class SchemaRouterOptions {
2527

src/main/java/io/vertx/json/schema/common/BaseSchemaParser.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
/**
2525
* @author Francesco Guardiani @slinkydeveloper
2626
*/
27+
@Deprecated
2728
public abstract class BaseSchemaParser implements SchemaParserInternal {
2829

2930
protected final List<ValidatorFactory> validatorFactories;

src/main/java/io/vertx/json/schema/common/SchemaParserInternal.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import java.net.URI;
1818

19+
@Deprecated
1920
public interface SchemaParserInternal extends SchemaParser {
2021

2122
@Override

src/main/java/io/vertx/json/schema/draft201909/Draft201909SchemaParser.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.net.URI;
2525
import java.util.*;
2626

27+
@Deprecated
2728
public class Draft201909SchemaParser extends BaseSchemaParser {
2829

2930
protected Draft201909SchemaParser(SchemaRouter router) {

0 commit comments

Comments
 (0)