Skip to content

Commit

Permalink
fix: extract resource name on global rule and plugin metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
bzp2010 committed Jul 19, 2024
1 parent 88f2946 commit 994a431
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 7 additions & 5 deletions apps/cli/src/command/lint.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ export const LintTask = (): ListrTask<{ local: ADCSDK.Configuration }> => ({
const resourceType = pluralize.singular(error.path[0] as string);
const resource = ctx.local[error.path[0]][error.path[1]];
const resourceName =
resourceType === 'ssl'
? resource.snis
: resourceType === 'consumer'
? resource.username
: resource.name;
resourceType === 'global_rule' || resourceType === 'plugin_metadata'
? error.path[1]
: resourceType === 'ssl'
? resource.snis
: resourceType === 'consumer'
? resource.username
: resource.name;
err += `#${idx + 1} ${
error.message
} at ${resourceType}: "${resourceName}", field: "${(
Expand Down
2 changes: 0 additions & 2 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,6 @@
},
"methods": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -618,7 +617,6 @@
},
"ssl_protocols": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"enum": [
Expand Down

0 comments on commit 994a431

Please sign in to comment.