Skip to content

Instantly share code, notes, and snippets.

@itxtoledo
Created December 4, 2024 20:44
Show Gist options
  • Save itxtoledo/b46aa179ad4844027fe646f9658c719e to your computer and use it in GitHub Desktop.
Save itxtoledo/b46aa179ad4844027fe646f9658c719e to your computer and use it in GitHub Desktop.
JSON Schema for validating SMTP configurations. This schema ensures that each configuration in an array contains the required properties (host, port, user, and pass) with the correct data types and disallows additional properties.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "array",
"items": {
"type": "object",
"properties": {
"host": {
"type": "string"
},
"port": {
"type": "number"
},
"user": {
"type": "string"
},
"pass": {
"type": "string"
}
},
"required": ["host", "port", "user", "pass"],
"additionalProperties": false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment