From 7afe00f06a0cf0bf4f079dcc86e2241cc3dc9832 Mon Sep 17 00:00:00 2001
From: Brandon Millman <brandon.millman@gmail.com>
Date: Fri, 23 Feb 2018 11:56:50 -0800
Subject: Use Schema interface from @0xproject/json-schemas

---
 packages/sra-report/src/index.ts | 23 +++++++++++++----------
 packages/sra-report/src/types.ts |  3 ---
 2 files changed, 13 insertions(+), 13 deletions(-)
 delete mode 100644 packages/sra-report/src/types.ts

diff --git a/packages/sra-report/src/index.ts b/packages/sra-report/src/index.ts
index fe100bd42..a24de377a 100644
--- a/packages/sra-report/src/index.ts
+++ b/packages/sra-report/src/index.ts
@@ -1,7 +1,7 @@
 #!/usr/bin/env node
 
 import { assert } from '@0xproject/assert';
-import { schemas } from '@0xproject/json-schemas';
+import { Schema, schemas } from '@0xproject/json-schemas';
 import chalk from 'chalk';
 import * as _ from 'lodash';
 import * as newman from 'newman';
@@ -11,7 +11,6 @@ import * as sraReportCollectionJSON from '../postman_configs/collections/sra_rep
 import * as kovanTokensEnvironmentJSON from '../postman_configs/environments/kovan_tokens.postman_environment.json';
 import * as mainnetTokensEnvironmentJSON from '../postman_configs/environments/mainnet_tokens.postman_environment.json';
 
-import { Schema } from './types';
 import { utils } from './utils';
 
 const DEFAULT_NETWORK_ID = 1;
@@ -74,14 +73,18 @@ function createGlobals(url: string, schemaList: Schema[]) {
         enabled: true,
         type: 'text',
     };
-    const schemaGlobalsValues = _.map(schemaList, (schema: Schema) => {
-        return {
-            key: convertSchemaIdToKey(schema.id),
-            value: JSON.stringify(schema),
-            enabled: true,
-            type: 'text',
-        };
-    });
+    const schemaGlobalsValues = _.compact(_.map(schemaList, (schema: Schema) => {
+        if (_.isUndefined(schema.id)) {
+            return undefined;
+        } else {
+            return {
+                key: convertSchemaIdToKey(schema.id),
+                value: JSON.stringify(schema),
+                enabled: true,
+                type: 'text',
+            };
+        }
+    }));
     const globalsValues = _.concat(schemaGlobalsValues, urlGlobalsValue);
     const globals = {
         values: globalsValues,
diff --git a/packages/sra-report/src/types.ts b/packages/sra-report/src/types.ts
deleted file mode 100644
index f08ef4042..000000000
--- a/packages/sra-report/src/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface Schema {
-    id: string;
-}
-- 
cgit v1.2.3