Skip to content

Commit

Permalink
lint: deduplicate StorageOptionsConf sub-schema
Browse files Browse the repository at this point in the history
Via a definition. Don't do this with the rest, as this is the only
sub-config type that appears multiple times and is thus worth the
effort.
  • Loading branch information
mvdan committed Oct 25, 2017
1 parent 2ccf315 commit f743140
Showing 1 changed file with 40 additions and 68 deletions.
108 changes: 40 additions & 68 deletions lint/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,44 @@ const confSchema = `{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"additionalProperties": false,
"definitions": {
"StorageOptions": {
"type": ["object", "null"],
"additionalProperties": false,
"properties": {
"database": {
"type": "integer"
},
"enable_cluster": {
"type": "boolean"
},
"host": {
"type": "string"
},
"hosts": {
"type": ["array", "null"]
},
"optimisation_max_active": {
"type": "integer"
},
"optimisation_max_idle": {
"type": "integer"
},
"password": {
"type": "string"
},
"port": {
"type": "integer"
},
"type": {
"type": "string"
},
"username": {
"type": "string"
}
}
}
},
"properties": {
"allow_insecure_configs": {
"type": "boolean"
Expand Down Expand Up @@ -105,40 +143,7 @@ const confSchema = `{
"type": "string"
},
"cache_storage": {
"type": ["object", "null"],
"additionalProperties": false,
"properties": {
"database": {
"type": "integer"
},
"enable_cluster": {
"type": "boolean"
},
"host": {
"type": "string"
},
"hosts": {
"type": ["array", "null"]
},
"optimisation_max_active": {
"type": "integer"
},
"optimisation_max_idle": {
"type": "integer"
},
"password": {
"type": "string"
},
"port": {
"type": "integer"
},
"type": {
"type": "string"
},
"username": {
"type": "string"
}
}
"$ref": "#/definitions/StorageOptions"
},
"close_connections": {
"type": "boolean"
Expand Down Expand Up @@ -526,40 +531,7 @@ const confSchema = `{
"type": "string"
},
"storage": {
"type": ["object", "null"],
"additionalProperties": false,
"properties": {
"database": {
"type": "integer"
},
"enable_cluster": {
"type": "boolean"
},
"host": {
"type": "string"
},
"hosts": {
"type": ["array", "null"]
},
"optimisation_max_active": {
"type": "integer"
},
"optimisation_max_idle": {
"type": "integer"
},
"password": {
"type": "string"
},
"port": {
"type": "integer"
},
"type": {
"type": "string"
},
"username": {
"type": "string"
}
}
"$ref": "#/definitions/StorageOptions"
},
"suppress_default_org_store": {
"type": "boolean"
Expand Down

0 comments on commit f743140

Please sign in to comment.