Skip to content

Conversation

@mrjones2014
Copy link
Owner

Fixes #65

Problem

When using configuration like:

{
  "yaml.schemas": {
    "./some/relative/schema.json": "relpath/*"
  }
}

The Settings.expand() function was incorrectly expanding the dots in the file path "./some/relative/schema.json", resulting in:

{
  yaml = {
    schemas = {
      ["/"] = {
        ["some/relative/schema"] = {
          json = "relpath/*"
        }
      }
    }
  }
}

Root Cause

The Settings.expand() function recursively expands all dotted keys in all nested tables. However, this is incorrect for properties like yaml.schemas which have:

  • type: "object" in their JSON schema
  • No properties field (indicating a free-form dictionary)

These "terminal objects" have user-defined keys (like file paths, URLs) that should NOT be treated as nested property paths.

We fix this by generating a lookup table of "terminal object" key paths at build time. Then, when dot-expanding, we stop expanding if the key path is terminal.

@mrjones2014 mrjones2014 force-pushed the mrj/65/fix-terminal-dot-splitting branch from 26ea17c to b1ce601 Compare November 10, 2025 15:26
@mrjones2014 mrjones2014 merged commit 986cdd8 into master Nov 10, 2025
2 checks passed
@mrjones2014 mrjones2014 deleted the mrj/65/fix-terminal-dot-splitting branch November 10, 2025 15:27
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.

[Bug]: dotted key splitting breaks when key is in terminal position and is allowed to contain dots

2 participants