Skip to content

Commit 658adae

Browse files
authored
feat: Loosen requests in events schema (#147)
Remove all the properties except those that Snuba cares about (headers, url, method). Being too strict can cause unnecessary schema validation failures. In this case the "data" did not always match the values we saw in prod.
1 parent ca5b365 commit 658adae

File tree

1 file changed

+0
-81
lines changed

1 file changed

+0
-81
lines changed

schemas/events.v1.schema.json

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,42 +1767,6 @@
17671767
{
17681768
"type": "object",
17691769
"properties": {
1770-
"body_size": {
1771-
"description": " HTTP request body size.",
1772-
"type": ["integer", "null"],
1773-
"minimum": 0
1774-
},
1775-
"cookies": {
1776-
"description": " The cookie values.\n\n Can be given unparsed as string, as dictionary, or as a list of tuples.",
1777-
"anyOf": [
1778-
{
1779-
"$ref": "#/definitions/Cookies"
1780-
},
1781-
{
1782-
"type": "null"
1783-
}
1784-
]
1785-
},
1786-
"data": {
1787-
"description": " Request data in any format that makes sense.\n\n SDKs should discard large and binary bodies by default. Can be given as string or\n structural data of any format.",
1788-
"type": [
1789-
"array",
1790-
"object",
1791-
"string",
1792-
"integer",
1793-
"null",
1794-
"boolean"
1795-
]
1796-
},
1797-
"env": {
1798-
"description": " Server environment data, such as CGI/WSGI.\n\n A dictionary containing environment information passed from the server. This is where\n information such as CGI/WSGI/Rack keys go that are not HTTP headers.\n\n Sentry will explicitly look for `REMOTE_ADDR` to extract an IP address.",
1799-
"type": ["object", "null"],
1800-
"additionalProperties": true
1801-
},
1802-
"fragment": {
1803-
"description": " The fragment of the request URL.",
1804-
"type": ["string", "null"]
1805-
},
18061770
"headers": {
18071771
"description": " A dictionary of submitted headers.\n\n If a header appears multiple times it, needs to be merged according to the HTTP standard\n for header merging. Header names are treated case-insensitively by Sentry.",
18081772
"anyOf": [
@@ -1814,55 +1778,10 @@
18141778
}
18151779
]
18161780
},
1817-
"inferred_content_type": {
1818-
"description": " The inferred content type of the request payload.",
1819-
"type": ["string", "null"]
1820-
},
18211781
"method": {
18221782
"description": " HTTP request method.",
18231783
"type": ["string", "null"]
18241784
},
1825-
"query_string": {
1826-
"description": " The query string component of the URL.\n\n Can be given as unparsed string, dictionary, or list of tuples.\n\n If the query string is not declared and part of the `url`, Sentry moves it to the\n query string.",
1827-
"anyOf": [
1828-
{
1829-
"anyOf": [
1830-
{
1831-
"type": "string"
1832-
},
1833-
{
1834-
"anyOf": [
1835-
{
1836-
"type": "object",
1837-
"additionalProperties": {
1838-
"type": ["string", "null"]
1839-
}
1840-
},
1841-
{
1842-
"type": "array",
1843-
"items": {
1844-
"type": ["array", "null"],
1845-
"items": [
1846-
{
1847-
"type": ["string", "null"]
1848-
},
1849-
{
1850-
"type": ["string", "null"]
1851-
}
1852-
],
1853-
"maxItems": 2,
1854-
"minItems": 2
1855-
}
1856-
}
1857-
]
1858-
}
1859-
]
1860-
},
1861-
{
1862-
"type": "null"
1863-
}
1864-
]
1865-
},
18661785
"url": {
18671786
"description": " The URL of the request if available.\n\nThe query string can be declared either as part of the `url`, or separately in `query_string`.",
18681787
"type": ["string", "null"]

0 commit comments

Comments
 (0)