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 nested config #66

Merged
merged 3 commits into from
Apr 26, 2024
Merged

Fix nested config #66

merged 3 commits into from
Apr 26, 2024

Conversation

ash-jc-allen
Copy link
Owner

Currently, there is a bug that prevents deep-nested config fields from being validated. This is down to the way I was reading the config files and adding their values to the ValidationRepository. If a field was nested more than 2 times, only the first field at that level would be added to the repository.

For example, say we have this short-url config field:

return [
    'prefix' => 'short',

    'tracking' => [
        'fields' => [
            'ip_address' => true,
            'operating_system' => true,
        ],
    ],
];

In this instance, the ValidationRepository would only load the following values:

  • short-url.prefix
  • short-url.tracking.fields.ip_address

short-url.tracking.fields.operating_system's value would not be loaded. This means the field couldn't be validated as expected.

@ash-jc-allen ash-jc-allen merged commit dac1886 into master Apr 26, 2024
26 checks passed
@ash-jc-allen ash-jc-allen deleted the fix/nested-config branch April 26, 2024 16:12
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.

1 participant