martin-g commented on code in PR #3466:
URL: https://github.com/apache/avro/pull/3466#discussion_r2418640717
##########
lang/js/lib/schemas.js:
##########
@@ -2029,10 +2029,23 @@ function getOpts(attrs, opts) {
throw new Error('invalid type: null (did you mean "null"?)');
}
opts = opts || {};
- opts.registry = opts.registry || {};
- opts.namespace = attrs.namespace || opts.namespace;
- opts.logicalTypes = opts.logicalTypes || {};
- return opts;
+
+ // Ensure registry and logicalTypes exist and are preserved by reference so
+ // type definitions can accumulate across recursive calls.
+ if (!opts.registry) {
Review Comment:
I simplified it with
https://github.com/apache/avro/pull/3466/commits/28fb6c0fec5077b7f0a5fc36c983fb7e1c50b18b
If you have concerns we will revert it in a follow-up PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]