Skip to content

[config] Bug: Validation Logic for Configuration File Extension #75

@indraneel12

Description

@indraneel12

ConfigurationParser.fromFile is currently case-sensitive to file extension. Expectedly, it should not have been case-sensitive like both of its upstream dependencies which are not restricted to accepting only case-sensitive file extensions:

...
if (filePath.endsWith('.json')) {
...
} else if (filePath.endsWith('.yaml') || filePath.endsWith('.yml')) {
...
throw UnsupportedError('Unsupported file extension: $filePath');

This bug results in a crash while loading external configurations (JSON or YAML) from, for example, configuration files with a fully uppercase filename.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions