-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(utils): support record-level default schema values (#431)
Before this change, during the process of filling default configuration values, if a record existed in the schema with a structure similar to the following: ``` { "default": { "some_field": "record_level_default" }, "fields": [ { "some_field": { "type": "string", "default": "field_level_default" } } ] } ``` the value `record_level_default` would be ignored and the field set to the `field_level_default` value. Similarly, in case of no field-level default, the field would be set to `null`. This commit modifies the utils/fillConfigRecord logic to assign fields with record-level default values when available. Example of default configuration values that were previously ignored: https://github.com/Kong/kong/blob/8fe14097a17cf904676672fc8cdaabe5e02e4a2d/kong/plugins/opentelemetry/schema.lua#L49 https://github.com/Kong/kong/blob/8fe14097a17cf904676672fc8cdaabe5e02e4a2d/kong/plugins/opentelemetry/schema.lua#L90
- Loading branch information
Showing
3 changed files
with
180 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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