You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2025/08/18 21:38:00 UTC
[jira] [Updated] (AVRO-4173) [JavaScript] Incorrect type resolution in nested schemas
[ https://issues.apache.org/jira/browse/AVRO-4173?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated AVRO-4173:
---------------------------------
Labels: pull-request-available (was: )
> [JavaScript] Incorrect type resolution in nested schemas
> --------------------------------------------------------
>
> Key: AVRO-4173
> URL: https://issues.apache.org/jira/browse/AVRO-4173
> Project: Apache Avro
> Issue Type: Bug
> Components: js
> Reporter: Tyler Harwood
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Namespace inheritance is broken when parsing nested record types with mixed explicit and inherited namespaces. This causes type resolution to fail with "undefined type name" errors.
>
> Example code to reproduce the bug:
> {code:java}
> const avro = require('avro-js');
> const schema = {
> type: 'record',
> name: 'Parent',
> namespace: 'parent.ns',
> fields: [
> {
> name: 'child_field',
> type: {
> type: 'record',
> name: 'Child', // No namespace - should inherit 'parent.ns'
> fields: [{name: 'value', type: 'int'}]
> }
> },
> {
> name: 'other_field',
> type: {
> type: 'record',
> name: 'Other',
> namespace: 'different.ns', // Explicit namespace corrupts context
> fields: [{name: 'data', type: 'int'}]
> }
> },
> {
> name: 'reference_field',
> type: 'Child' // References Child - should resolve to 'parent.ns.Child'
> }
> ]
> };
> // This fails with "undefined type name: different.ns.Child"
> const type = avro.parse(schema);
> {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)