Skip to content

Instantly share code, notes, and snippets.

@Fazzani
Last active October 28, 2020 11:08
Show Gist options
  • Save Fazzani/cc20c3e013bf414eefe6dd9be1b67020 to your computer and use it in GitHub Desktop.
Save Fazzani/cc20c3e013bf414eefe6dd9be1b67020 to your computer and use it in GitHub Desktop.
Health check .net core json schema
{
"status": "Unhealthy",
"totalDuration": "00:00:51.8415331",
"entries": {
"storage": { "data": {}, "description": "Hôte inconnu", "duration": "00:00:23.2322776", "exception": "Hôte inconnu", "status": "Degraded" },
"external az storage": { "data": {}, "duration": "00:00:00.1167734", "status": "Healthy" },
"docapost": { "data": {}, "duration": "00:00:01.5491822", "status": "Healthy" },
"cosmosdb": { "data": {}, "description": "Hôte inconnu", "duration": "00:00:00.2694373", "exception": "Hôte inconnu", "status": "Unhealthy" }
}
}
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://example.com/object1603880810.json",
"title": "healthcheck",
"type": "object",
"required": ["status", "totalDuration", "entries"],
"properties": {
"status": {
"$id": "#root/status",
"title": "Status",
"type": "string",
"default": "Healthy",
"enum": ["Healthy", "Unhealthy", "Degraded"],
"examples": ["Healthy", "Unhealthy", "Degraded"]
},
"totalDuration": {
"$id": "#root/totalDuration",
"title": "Totalduration",
"type": "string",
"default": "",
"examples": ["00:00:51.8415331"],
"pattern": "^\\d+:\\d{2}:\\d{2}\\.\\d{7}$"
},
"entries": {
"$id": "#root/entries",
"title": "Entries",
"type": "object",
"additionalProperties": {
"type": "object",
"required": ["data", "duration", "status"],
"properties": {
"data": {
"$id": "#root/entries/storage/data",
"title": "Data",
"type": "object",
"required": [],
"properties": {}
},
"description": {
"$id": "#root/entries/storage/description",
"title": "Description",
"type": "string",
"default": "",
"examples": ["Hôte inconnu"],
"pattern": "^.*$"
},
"duration": {
"$id": "#root/entries/storage/duration",
"title": "Duration",
"type": "string",
"default": "",
"examples": ["00:00:26.4606503"],
"pattern": "^\\d+:\\d{2}:\\d{2}\\.\\d{7}$"
},
"exception": {
"$id": "#root/entries/storage/exception",
"title": "Exception",
"type": "string",
"default": "",
"examples": ["Hôte inconnu"],
"pattern": "^.*$"
},
"status": {
"$id": "#root/entries/storage/status",
"title": "Status",
"type": "string",
"default": "",
"enum": ["Healthy", "Unhealthy", "Degraded"],
"examples": ["Healthy", "Unhealthy", "Degraded"]
}
}
}
}
}
}
@Fazzani
Copy link
Author

Fazzani commented Oct 28, 2020

Json response maybe validated by this online tool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment