Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: lookup shared schemas by fully qualified name #132

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

crimsonmagick
Copy link

Shared lookup fails in the case that two Avro records have the same namespace and the referrer defines the referent's name without using a fully qualified name. This resolves the issue by using the referent's fully qualified name for the lookup.

For example, if the referent is defined as:

{
  "name": "ToBeReferred",
  "type": "record",
  "namespace": "com.example_refer",
  ...
}

and referrer with the same namespace:

{
  "name": "TheReferrer",
  "doc": "A complex object referencing object from another schemata",
  "namespace": "com.example_refer",
  "type": "record",
  "fields": [
    {
      "name": "externalObject",
      "type": "ToBeReferred",
      "doc": "An object from another schemata"
    }

Since the type is not fully qualified, shared lookup fails. We use this shorthand abundantly in our projects, so unfortunately page load fails in current state.

Shared lookup fails in the case that two Avro records have the
same namespace and the referrer defines the referent's name without using
a fully qualified name. This resolves the issue by using the
referent's fully qualified name for the lookup.
@crimsonmagick
Copy link
Author

Reverted unnecessary yarn.lock change which caused the pipeline/actions to fail. Verified by running the actions on my "fork": https://github.com/crimsonmagick/avrodoc-plus/actions/runs/5036475017/jobs/9032647637?pr=1

@mikaello mikaello changed the title Updated Schema.js to lookup shared schemas by fully qualified name fix: lookup shared schemas by fully qualified name Oct 19, 2023
@mikaello
Copy link
Owner

mikaello commented Oct 19, 2023

Thanks! And sorry for the delay, I didn't notice this pull request.

Publised as v1.4.1: https://github.com/mikaello/avrodoc-plus/releases/tag/v1.4.1

@mikaello mikaello merged commit 5f1ae87 into mikaello:main Oct 19, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants