Skip to content

Error during dereference : StreamConstraintsException: Document nesting depth (1001) exceeds the maximum allowed (1000) #6046

Open
@subhanshu-shukla-ril

Description

@subhanshu-shukla-ril

Description

Registry
Version
:3.0.6
Persistence type:in-memory

Environment

docker-compose.yml

version: "3.8"

services:
  apicurio-registry:
    image: apicurio/apicurio-registry:3.0.6
    ports:
      - "8080:8080"
    restart: unless-stopped

  apicurio-registry-ui:
    image: apicurio/apicurio-registry-ui:3.0.6
    ports:
      - "8888:8080"
    restart: unless-stopped
    depends_on:
      - apicurio-registry

Steps to Reproduce

Upload below schema as an artifact

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "TargetNodeSpec.schema.json",
  "title": "TargetNodeSpec",
  "definitions": {
    "TargetNodeSpec": {
      "type": "object",
      "properties": {
        "orgName": {
          "type": "string",
          "description": "Organisation name."
        },
        "envName": {
          "type": "string",
          "description": "Environment name."
        },
        "enabled": {
          "type": "boolean",
          "description": "If set to true, target server is enabled for serving traffic."
        },
        "host": {
          "type": "string",
          "description": "Host name of the target."
        },
        "port": {
          "type": "string",
          "description": "Port of the target."
        },
        "targetNodes": {
          "type": "array",
          "items": {
            "$dynamicRef": "#TargetNodeSpec"
          }
        }
      },
      "$id": "TargetNodeSpec",
      "$dynamicAnchor": "TargetNodeSpec"
    }
  }
}

curl http://localhost:8080/apis/registry/v2/ids/globalIds/{globaIdOfSchema}?dereference=true

Expected vs Actual Behaviour

Expecting: de-refrenced schema or same schema.
Actual:

{"message":"Document nesting depth (1001) exceeds the maximum allowed (1000, from `StreamWriteConstraints.getMaxNestingDepth()`)","error_code":500,"detail":"StreamConstraintsException: Document nesting depth (1001) exceeds the maximum allowed (1000, from `StreamWriteConstraints.getMaxNestingDepth()`)","name":"EncodeException"}

Logs

apicurio-registry-1     | 	at io.apicurio.registry.logging.LoggingInterceptor_Bean.intercept(Unknown Source)
apicurio-registry-1     | 	at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:42)
apicurio-registry-1     | 	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:70)
apicurio-registry-1     | 	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:62)
apicurio-registry-1     | 	at io.quarkus.resteasy.runtime.QuarkusRestPathTemplateInterceptor.restMethodInvoke(QuarkusRestPathTemplateInterceptor.java:39)
apicurio-registry-1     | 	at io.quarkus.resteasy.runtime.QuarkusRestPathTemplateInterceptor_Bean.intercept(Unknown Source)
apicurio-registry-1     | 	at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:42)
apicurio-registry-1     | 	at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:30)
apicurio-registry-1     | 	at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:27)
apicurio-registry-1     | Caused by: com.fasterxml.jackson.core.exc.StreamConstraintsException: Document nesting depth (1001) exceeds the maximum allowed (1000, from `StreamWriteConstraints.getMaxNestingDepth()`)
apicurio-registry-1     | 	at com.fasterxml.jackson.core.StreamWriteConstraints._constructException(StreamWriteConstraints.java:177)
apicurio-registry-1     | 	at com.fasterxml.jackson.core.StreamWriteConstraints.validateNestingDepth(StreamWriteConstraints.java:162)
apicurio-registry-1     | 	at com.fasterxml.jackson.core.json.WriterBasedJsonGenerator.writeStartObject(WriterBasedJsonGenerator.java:319)
apicurio-registry-1     | 	at io.vertx.json.schema.impl.JsonProxyEncoder.encodeJson(JsonProxyEncoder.java:75)
apicurio-registry-1     | 	at io.vertx.json.schema.impl.JsonProxyEncoder.encodeJson(JsonProxyEncoder.java:78)
apicurio-registry-1     | 	at io.vertx.json.schema.impl.JsonProxyEncoder.encodeJson(JsonProxyEncoder.java:78)
apicurio-registry-1     | 	at io.vertx.json.schema.impl.JsonProxyEncoder.encodeJson(JsonProxyEncoder.java:78)
apicurio-registry-1     | 	at io.vertx.json.schema.impl.JsonProxyEncoder.encodeJson(JsonProxyEncoder.java:78)
apicurio-registry-1     | 	at io.vertx.json.schema.impl.JsonProxyEncoder.encodeJson(JsonProxyEncoder.java:78)
apicurio-registry-1     | 	at io.vertx.json.schema.impl.JsonProxyEncoder.encodeJson(JsonProxyEncoder.java:78)
apicurio-registry-1     | 	at io.vertx.json.schema.impl.JsonProxyEncoder.encodeJson(JsonProxyEncoder.java:78)

Metadata

Metadata

Assignees

Type

Projects

Status

Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions