fix(config): exclude $schema from extra parameters sent to DNS APIs#576
Merged
NewFuture merged 2 commits intoNov 3, 2025
Merged
Conversation
Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] The parameter
fix(config): exclude $schema from extra parameters sent to DNS APIs
Nov 3, 2025
$schema is not recognized. (v4.1.1)
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR prevents the $schema field from JSON configuration files from being collected as an extra field. The $schema field is a standard JSON Schema reference used for validation and IDE support, and should not be passed to DNS provider APIs.
- Added
$schemato the set of known configuration keys that are filtered out from extra fields - Added a comprehensive test to verify
$schemais excluded while other extra fields are still collected
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| ddns/config/config.py | Added $schema to the _known_keys set to exclude it from extra field collection |
| tests/test_config_extra.py | Added test case to verify $schema field is properly excluded from extra fields |
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.
The
$schemafield from JSON config files was being passed to DNS provider APIs as an extra parameter, causingUnknownParametererrors in v4.1.1 (worked in v4.1.0).Root Cause
$schemawas not in the_known_keysset, so it was collected into theextradict and unpacked via**extrawhen calling provider methods like_query_record()and_create_record().Changes
ddns/config/config.py: Added$schemato_known_keysset to exclude it from extra parameterstests/test_config_extra.py: Added test case to verify$schemaexclusionExample
Before fix, using this config:
{ "$schema": "https://ddns.newfuture.cc/schema/v4.1.json", "dns": "tencentcloud", "extra": { "Remark": "DDNS" } }Would result in
extra = {"$schema": "...", "Remark": "DDNS"}being sent to API.After fix:
extra = {"Remark": "DDNS"}(correct).Original prompt
$schemais not recognized. (v4.1.1) #575💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.