{"record":{"id":"0a01d6ad5c9bf3f1","repo":"risingwavelabs/risingwave","slug":"need-url-to-be-a-file-or-a-http-based-got-url","errorCode":null,"errorMessage":"need url to be a file or a http based, got {url}","messagePattern":"need url to be a file or a http based, got (.+?)","errorType":"error_code","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/connector/codec/src/decoder/json/mod.rs","lineNumber":82,"sourceCode":"    Request { url: String, source: reqwest::Error },\n    #[error(\"schema from {url} not valid JSON\")]\n    SchemaNotJsonSerde {\n        url: String,\n        source: serde_json::Error,\n    },\n    #[error(\n        \"ref `{ref_string}` cannot be resolved as a pointer, and `{ref_fragment}` cannot be found in the schema\"\n    )]\n    JsonRefPointerNotFound {\n        ref_string: String,\n        ref_fragment: String,\n    },\n    #[error(\"json ref error\")]\n    JsonRef {\n        #[from]\n        source: std::io::Error,\n    },\n    #[error(\"need url to be a file or a http based, got {url}\")]\n    UnsupportedUrl { url: String },\n    #[error(transparent)]\n    Uncategorized(\n        #[from]\n        #[backtrace]\n        anyhow::Error,\n    ),\n}\n\ntype Result<T, E = Error> = std::result::Result<T, E>;\n\n#[derive(Debug)]\npub struct JsonRef {\n    schema_cache: HashMap<String, Value>,\n}\n\nimpl JsonRef {\n    fn new() -> JsonRef {","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/codec/src/decoder/json/mod.rs#L64-L100","documentation":"Error::UnsupportedUrl is raised by the JSON schema $ref resolver in JsonRef::deref (src/connector/codec/src/decoder/json/mod.rs:151). When a JSON schema contains a `$ref` pointing to an external document, the resolver only supports fetching it via `http`/`https` or reading it via the `file` scheme; any other URL scheme produces this error naming the offending URL.","triggerScenarios":"A `CREATE SOURCE ... FORMAT PLAIN ENCODE JSON` (or JSON schema registry-based) declaration whose schema document contains `$ref` values that resolve to a URL with a scheme other than file/http/https, e.g. `urn:`, `data:`, `ftp:`, or a relative `$ref` joined against a base retrieval_url with an unsupported scheme.","commonSituations":"Users register a JSON schema exported from a tool that emits `urn:uuid:...` or `data:application/json,...` refs; a `$ref` to a schema served only over a private registry scheme; Kafka Confluent Schema Registry refs copied with custom scheme handlers.","solutions":["Rewrite the `$ref` to an absolute `http://` or `https://` URL that RisingWave can fetch","Serve the referenced schema over a local HTTP endpoint or place it at a `file:///abs/path.json` URL accessible to the RisingWave node","Inline the referenced definition into the schema so no external `$ref` remains","Check the resolved URL scheme by printing it; ensure `Url::join` of the relative ref against the retrieval_url yields http/https/file"],"exampleFix":"// before\n{\"$ref\": \"urn:myorg:schemas:order\"}\n// after\n{\"$ref\": \"https://schema-registry.example.com/schemas/order.json\"}","handlingStrategy":"validation","validationCode":"use url::Url;\nfn ref_url_supported(ref_string: &str, base: &Url) -> bool {\n    base.join(ref_string)\n        .ok()\n        .map(|u| matches!(u.scheme(), \"http\" | \"https\" | \"file\"))\n        .unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only author $ref values with http(s):// or file:/// URLs","Inline shared definitions to avoid external refs entirely","Lint schemas before registering them to reject non-http/file ref schemes"],"tags":["url","schema-ref","unsupported"],"backgroundTag":"invalid-url-format","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}