Browse Source

feat(symbolicator): Add casing to sources schema (#12755)

* feat(symbolicator): Add casing to sources schema

* fix: Adapt to schema in getsentry/symbolicator#26
Markus Unterwaditzer 5 years ago
parent
commit
6307989168
1 changed files with 24 additions and 4 deletions
  1. 24 4
      src/sentry/lang/native/symbolicator.py

+ 24 - 4
src/sentry/lang/native/symbolicator.py

@@ -50,15 +50,34 @@ VALID_FILE_TYPES = (
     'breakpad',
 )
 
+VALID_CASINGS = (
+    'lowercase',
+    'uppercase',
+    'default'
+)
+
+LAYOUT_SCHEMA = {
+    'type': 'object',
+    'properties': {
+        'type': {
+            'type': 'string',
+            'enum': list(VALID_LAYOUTS),
+        },
+        'casing': {
+            'type': 'string',
+            'enum': list(VALID_CASINGS),
+        },
+    },
+    'required': ['type'],
+    'additionalProperties': False,
+}
+
 COMMON_SOURCE_PROPERTIES = {
     'id': {
         'type': 'string',
         'minLength': 1,
     },
-    'layout': {
-        'type': 'string',
-        'enum': list(VALID_LAYOUTS),
-    },
+    'layout': LAYOUT_SCHEMA,
     'filetypes': {
         'type': 'array',
         'items': {
@@ -68,6 +87,7 @@ COMMON_SOURCE_PROPERTIES = {
     },
 }
 
+
 S3_SOURCE_SCHEMA = {
     'type': 'object',
     'properties': dict(