Skip to content

Commit

Permalink
go.d.plugin: jsonschema allow array/object to be null (netdata#17166)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyam8 committed Mar 14, 2024
1 parent 410884d commit c56a123
Show file tree
Hide file tree
Showing 55 changed files with 468 additions and 117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@
"headers": {
"title": "Headers",
"description": "Additional HTTP headers to include in the request.",
"type": "object",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "string"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@
"headers": {
"title": "Headers",
"description": "Additional HTTP headers to include in the request.",
"type": "object",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "string"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@
"headers": {
"title": "Headers",
"description": "Additional HTTP headers to include in the request.",
"type": "object",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "string"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@
"headers": {
"title": "Headers",
"description": "Additional HTTP headers to include in the request.",
"type": "object",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "string"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@
"headers": {
"title": "Headers",
"description": "Additional HTTP headers to include in the request.",
"type": "object",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "string"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@
"headers": {
"title": "Headers",
"description": "Additional HTTP headers to include in the request.",
"type": "object",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "string"
}
Expand Down
35 changes: 28 additions & 7 deletions src/go/collectors/go.d.plugin/modules/coredns/config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,18 @@
"per_server_stats": {
"title": "Server selector",
"description": "Configures collection of per-server statistics. If left empty, no stats will be collected. Matching is performed against the `server` label value.",
"type": "object",
"type": [
"object",
"null"
],
"properties": {
"includes": {
"title": "Include",
"description": "Include servers whose names match any of the specified inclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme).",
"type": "array",
"type": [
"array",
"null"
],
"items": {
"title": "Server pattern",
"type": "string"
Expand All @@ -48,7 +54,10 @@
"excludes": {
"title": "Exclude",
"description": "Exclude servers whose names match any of the specified exclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme).",
"type": "array",
"type": [
"array",
"null"
],
"items": {
"title": "Server pattern",
"type": "string"
Expand All @@ -60,12 +69,18 @@
"per_zone_stats": {
"title": "Zone selector",
"description": "Configures collection of per-zone statistics. If left empty, no stats will be collected. Matching is performed against the `zone` label value.",
"type": "object",
"type": [
"object",
"null"
],
"properties": {
"includes": {
"title": "Include",
"description": "Include zones whose names match any of the specified inclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme).",
"type": "array",
"type": [
"array",
"null"
],
"items": {
"title": "Zone pattern",
"type": "string"
Expand All @@ -75,7 +90,10 @@
"excludes": {
"title": "Exclude",
"description": "Exclude zones whose names match any of the specified exclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme).",
"type": "array",
"type": [
"array",
"null"
],
"items": {
"title": "Zone pattern",
"type": "string"
Expand Down Expand Up @@ -116,7 +134,10 @@
"headers": {
"title": "Headers",
"description": "Additional HTTP headers to include in the request.",
"type": "object",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "string"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@
"headers": {
"title": "Headers",
"description": "Additional HTTP headers to include in the request.",
"type": "object",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "string"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@
"headers": {
"title": "Headers",
"description": "Additional HTTP headers to include in the request.",
"type": "object",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "string"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@
"headers": {
"title": "Headers",
"description": "Additional HTTP headers to include in the request.",
"type": "object",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "string"
}
Expand Down
15 changes: 12 additions & 3 deletions src/go/collectors/go.d.plugin/modules/dnsquery/config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
"record_types": {
"title": "Record types",
"description": "Types of DNS records to query for each server.",
"type": "array",
"type": [
"array",
"null"
],
"items": {
"type": "string",
"enum": [
Expand All @@ -63,7 +66,10 @@
"servers": {
"title": "Servers",
"description": "List of DNS servers to query.",
"type": "array",
"type": [
"array",
"null"
],
"items": {
"title": "DNS server",
"description": "IP address or hostname of the DNS server.",
Expand All @@ -78,7 +84,10 @@
"domains": {
"title": "Domains",
"description": "List of domains or subdomains to query. A random domain will be selected from this list at each iteration.",
"type": "array",
"type": [
"array",
"null"
],
"items": {
"title": "Domain",
"type": "string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@
"headers": {
"title": "Headers",
"description": "Additional HTTP headers to include in the request.",
"type": "object",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "string"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
"repositories": {
"title": "Repositories",
"description": "List of repositories to monitor.",
"type": "array",
"type": [
"array",
"null"
],
"items": {
"title": "Name",
"description": "The name of the repository.",
Expand Down Expand Up @@ -74,7 +77,10 @@
"headers": {
"title": "Headers",
"description": "Additional HTTP headers to include in the request.",
"type": "object",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "string"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@
"headers": {
"title": "Headers",
"description": "Additional HTTP headers to include in the request.",
"type": "object",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "string"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@
"headers": {
"title": "Headers",
"description": "Additional HTTP headers to include in the request.",
"type": "object",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "string"
}
Expand Down
10 changes: 8 additions & 2 deletions src/go/collectors/go.d.plugin/modules/example/config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
},
"charts": {
"title": "Charts configuration",
"type": "object",
"type": [
"object",
"null"
],
"properties": {
"type": {
"title": "Chart type",
Expand Down Expand Up @@ -65,7 +68,10 @@
},
"hidden_charts": {
"title": "Hidden charts configuration",
"type": "object",
"type": [
"object",
"null"
],
"properties": {
"type": {
"title": "Chart type",
Expand Down
30 changes: 24 additions & 6 deletions src/go/collectors/go.d.plugin/modules/filecheck/config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@
"files": {
"title": "File selector",
"description": "Configuration for monitoring specific files. If left empy, no files will be monitored.",
"type": "object",
"type": [
"object",
"null"
],
"properties": {
"include": {
"title": "Include",
"description": "Include files that match any of the specified include [patterns](https://golang.org/pkg/path/filepath/#Match).",
"type": "array",
"type": [
"array",
"null"
],
"items": {
"title": "Filepath",
"type": "string",
Expand All @@ -30,7 +36,10 @@
"exclude": {
"title": "Exclude",
"description": "Exclude files that match any of the specified exclude [patterns](https://golang.org/pkg/path/filepath/#Match).",
"type": "array",
"type": [
"array",
"null"
],
"items": {
"title": "Filepath",
"type": "string",
Expand All @@ -52,12 +61,18 @@
"dirs": {
"title": "Directory selector",
"description": "Configuration for monitoring specific directories. If left empy, no directories will be monitored.",
"type": "object",
"type": [
"object",
"null"
],
"properties": {
"include": {
"title": "Include",
"description": "Include directories that match any of the specified include [patterns](https://golang.org/pkg/path/filepath/#Match).",
"type": "array",
"type": [
"array",
"null"
],
"items": {
"title": "Directory",
"type": "string",
Expand All @@ -68,7 +83,10 @@
"exclude": {
"title": "Exclude",
"description": "Exclude directories that match any of the specified exclude [patterns](https://golang.org/pkg/path/filepath/#Match).",
"type": "array",
"type": [
"array",
"null"
],
"items": {
"title": "Directory",
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@
"headers": {
"title": "Headers",
"description": "Additional HTTP headers to include in the request.",
"type": "object",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "string"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@
"headers": {
"title": "Headers",
"description": "Additional HTTP headers to include in the request.",
"type": "object",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "string"
}
Expand Down
Loading

0 comments on commit c56a123

Please sign in to comment.