Merged
Conversation
Collaborator
There was a problem hiding this comment.
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
JsonConfigurationProviderandJsonConfigurationSourcethat load key/value pairs from a JSON file, with optional/required file semantics. ConfigurationManagergains a requiredcontent_root_pathconstructor parameter and a newadd_json_filemethod;ServiceCollection._create_configuration()automatically registersappsettings.jsonandappsettings.{environment}.json.- Updated documentation and tests to reflect the new JSON source and the new
ConfigurationManagerconstructor 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.