Skip to content

Add JSON source#64

Merged
AndreuCodina merged 1 commit intomainfrom
feature/add-json-source
Mar 1, 2026
Merged

Add JSON source#64
AndreuCodina merged 1 commit intomainfrom
feature/add-json-source

Conversation

@AndreuCodina
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 1, 2026 18:24
@coveralls
Copy link
Collaborator

Coverage Status

coverage: 99.35% (+0.04%) from 99.308%
when pulling ea9ee7c on feature/add-json-source
into 9986e23 on main.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds JSON file support as a configuration source, complementing the existing environment variable source. When a ServiceCollection is used, appsettings.json and appsettings.{environment}.json are now automatically loaded before environment variables, giving environment variables highest priority. It also adds a content_root_path parameter to ConfigurationManager to resolve relative JSON file paths.

Changes:

  • New JsonConfigurationProvider and JsonConfigurationSource that load key/value pairs from a JSON file, with optional/required file semantics.
  • ConfigurationManager gains a required content_root_path constructor parameter and a new add_json_file method; ServiceCollection._create_configuration() automatically registers appsettings.json and appsettings.{environment}.json.
  • Updated documentation and tests to reflect the new JSON source and the new ConfigurationManager constructor signature.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/wirio/configuration/json/json_configuration_provider.py New provider that reads and normalizes key/value pairs from a JSON file
src/wirio/configuration/json/json_configuration_source.py New source that builds a JsonConfigurationProvider
src/wirio/configuration/json/__init__.py New package marker for the JSON configuration module
src/wirio/configuration/configuration_manager.py Adds content_root_path to constructor and add_json_file public method
src/wirio/service_collection.py Auto-registers JSON file sources and passes content_root_path to ConfigurationManager
tests/configuration/test_json_configuration_provider.py New tests for JsonConfigurationProvider
tests/configuration/test_configuration_manager.py Updates existing tests to pass new required content_root_path="" argument
docs/pages/core-concepts/configuration.md Documents JSON file sources and the default precedence order

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AndreuCodina AndreuCodina merged commit bc1629a into main Mar 1, 2026
19 checks passed
@AndreuCodina AndreuCodina deleted the feature/add-json-source branch March 1, 2026 18:32
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.

3 participants