Skip to content

Commit 21a0117

Browse files
committed
Mark annotation JsonSerializableSchema as deprecated
1 parent 2382cd7 commit 21a0117

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/java/com/fasterxml/jackson/databind/jsonschema/JsonSerializableSchema.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@
1717
*
1818
* @author Ryan Heaton
1919
* @author Tatu Saloranta
20+
* @deprecated Since 2.2, we recommend use of external
21+
* <a href="https://github.com/FasterXML/jackson-module-jsonSchema">JSON Schema generator module</a>
2022
*/
2123
@Target(ElementType.TYPE)
2224
@Retention(RetentionPolicy.RUNTIME)
2325
@JacksonAnnotation
26+
@Deprecated
2427
public @interface JsonSerializableSchema
2528
{
2629
/**

src/main/java/com/fasterxml/jackson/databind/ser/std/BeanSerializerBase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable;
1616
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper;
1717
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor;
18-
import com.fasterxml.jackson.databind.jsonschema.JsonSerializableSchema;
1918
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
2019
import com.fasterxml.jackson.databind.node.ObjectNode;
2120
import com.fasterxml.jackson.databind.ser.*;
@@ -848,7 +847,8 @@ public JsonNode getSchema(SerializerProvider provider, Type typeHint)
848847
ObjectNode o = createSchemaNode("object", true);
849848
// [JACKSON-813]: Add optional JSON Schema id attribute, if found
850849
// NOTE: not optimal, does NOT go through AnnotationIntrospector etc:
851-
JsonSerializableSchema ann = _handledType.getAnnotation(JsonSerializableSchema.class);
850+
com.fasterxml.jackson.databind.jsonschema.JsonSerializableSchema ann =
851+
_handledType.getAnnotation(com.fasterxml.jackson.databind.jsonschema.JsonSerializableSchema.class);
852852
if (ann != null) {
853853
String id = ann.id();
854854
if (id != null && !id.isEmpty()) {

0 commit comments

Comments
 (0)