Repository: pmcelhaney/counterfact
Pull request #368 (2023-01-19 20:24:32)

fix duplicate imports of context object

changeset-bot[bot]: ###  ⚠️  No Changeset found

Latest commit: 3e530e4f983a760b2eb3fc9ac34ea99cc9d8284a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. **If these changes should result in a version bump, you need to add a changeset.**

<details><summary>This PR includes no changesets</summary>

  When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

</details>

[Click here to learn what changesets are, and how to add one](https://github.com/changesets/changesets/blob/master/docs/adding-a-changeset.md).

[Click here if you're a maintainer who wants to add a changeset to this PR](https://github.com/pmcelhaney/counterfact/new/fix-duplicate-context-imports?filename=.changeset/heavy-parrots-wait.md&value=---%0A%22counterfact%22%3A%20patch%0A---%0A%0Afix%20duplicate%20imports%20of%20context%20object%0A)



Patch:
diff --git a/.changeset/blue-cooks-agree.md b/.changeset/blue-cooks-agree.md
new file mode 100644
index 0000000..448f630
--- /dev/null
+++ b/.changeset/blue-cooks-agree.md
@@ -0,0 +1,5 @@
+---
+"counterfact": patch
+---
+
+fix duplicate imports of Context object
diff --git a/src/typescript-generator/context-coder.js b/src/typescript-generator/context-coder.js
index 65bfcbd..6c1337b 100644
--- a/src/typescript-generator/context-coder.js
+++ b/src/typescript-generator/context-coder.js
@@ -11,6 +11,10 @@ export class ContextCoder extends Coder {
       .replaceAll("~0", "~");
   }
 
+  get id() {
+    return "ContextCoder";
+  }
+
   names() {
     return super.names("Context");
   }


Test patch:
diff --git a/test/typescript-generator/__snapshots__/context-coder.test.js.snap b/test/typescript-generator/__snapshots__/context-coder.test.js.snap
new file mode 100644
index 0000000..77fd49b
--- /dev/null
+++ b/test/typescript-generator/__snapshots__/context-coder.test.js.snap
@@ -0,0 +1,6 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`a ContextCoder finds the request method in the URL 1`] = `
+"export { default } from \\"../$.context.js\\";
+"
+`;
diff --git a/test/typescript-generator/__snapshots__/end-to-end.test.js.snap b/test/typescript-generator/__snapshots__/end-to-end.test.js.snap
index 58b6669..75c15cd 100644
--- a/test/typescript-generator/__snapshots__/end-to-end.test.js.snap
+++ b/test/typescript-generator/__snapshots__/end-to-end.test.js.snap
@@ -47,9 +47,8 @@ Map {
           "cache": Map {
             "OperationTypeCoder@./petstore.yaml#/paths/~1pet/post@[object Object]:true" => "HTTP_POST",
             "OperationTypeCoder@./petstore.yaml#/paths/~1pet/put@[object Object]:true" => "HTTP_PUT",
-            "ContextCoder@./petstore.yaml#/paths/~1pet/post@paths/$.context.ts:false:true" => "Context",
+            "ContextCoder@paths/$.context.ts:false:true" => "Context",
             "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
-            "ContextCoder@./petstore.yaml#/paths/~1pet/put@paths/$.context.ts:false:true" => "Context2",
           },
           "exports": Map {
             "HTTP_POST" => Object {
@@ -91,7 +90,7 @@ Map {
             },
             "HTTP_PUT" => Object {
               "beforeExport": "",
-              "code": "({ query, path, header, body, context, proxy }: { query: never, path: never, header: never, body: Pet, context: typeof Context2, response: ResponseBuilderFactory<{
+              "code": "({ query, path, header, body, context, proxy }: { query: never, path: never, header: never, body: Pet, context: typeof Context, response: ResponseBuilderFactory<{
 200: {
           headers: {};
           content: {
@@ -172,7 +171,7 @@ class Context {
 ",
                     "code": "new Context()",
                     "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1pet/post",
+                    "id": "ContextCoder",
                     "isDefault": true,
                     "isType": false,
                     "name": "Context",
@@ -286,50 +285,6 @@ class Context {
                 "typeCache": Map {},
               },
             },
-            "Context2" => Object {
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "script": Script {
-                "cache": Map {
-                  "default" => "Context",
-                },
-                "exports": Map {
-                  "Context" => Object {
-                    "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/$.context.ts\\";
-  }
-}
-",
-                    "code": "new Context()",
-                    "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1pet/post",
-                    "isDefault": true,
-                    "isType": false,
-                    "name": "Context",
-                    "promise": Promise {},
-                    "typeDeclaration": "",
-                  },
-                },
-                "externalImports": Map {},
-                "imports": Map {},
-                "path": "paths/$.context.ts",
-                "repository": Repository {
-                  "scripts": [Circular],
-                  "writeFiles": [Function],
-                },
-                "typeCache": Map {},
-              },
-            },
           },
           "path": "path-types/pet.types.ts",
           "repository": Repository {
@@ -347,9 +302,8 @@ class Context {
           "cache": Map {
             "OperationTypeCoder@./petstore.yaml#/paths/~1pet/post@[object Object]:true" => "HTTP_POST",
             "OperationTypeCoder@./petstore.yaml#/paths/~1pet/put@[object Object]:true" => "HTTP_PUT",
-            "ContextCoder@./petstore.yaml#/paths/~1pet/post@paths/$.context.ts:false:true" => "Context",
+            "ContextCoder@paths/$.context.ts:false:true" => "Context",
             "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
-            "ContextCoder@./petstore.yaml#/paths/~1pet/put@paths/$.context.ts:false:true" => "Context2",
           },
           "exports": Map {
             "HTTP_POST" => Object {
@@ -391,7 +345,7 @@ class Context {
             },
             "HTTP_PUT" => Object {
               "beforeExport": "",
-              "code": "({ query, path, header, body, context, proxy }: { query: never, path: never, header: never, body: Pet, context: typeof Context2, response: ResponseBuilderFactory<{
+              "code": "({ query, path, header, body, context, proxy }: { query: never, path: never, header: never, body: Pet, context: typeof Context, response: ResponseBuilderFactory<{
 200: {
           headers: {};
           content: {
@@ -472,7 +426,7 @@ class Context {
 ",
                     "code": "new Context()",
                     "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1pet/post",
+                    "id": "ContextCoder",
                     "isDefault": true,
                     "isType": false,
                     "name": "Context",
@@ -586,50 +540,6 @@ class Context {
                 "typeCache": Map {},
               },
             },
-            "Context2" => Object {
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "script": Script {
-                "cache": Map {
-                  "default" => "Context",
-                },
-                "exports": Map {
-                  "Context" => Object {
-                    "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/$.context.ts\\";
-  }
-}
-",
-                    "code": "new Context()",
-                    "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1pet/post",
-                    "isDefault": true,
-                    "isType": false,
-                    "name": "Context",
-                    "promise": Promise {},
-                    "typeDeclaration": "",
-                  },
-                },
-                "externalImports": Map {},
-                "imports": Map {},
-                "path": "paths/$.context.ts",
-                "repository": Repository {
-                  "scripts": [Circular],
-                  "writeFiles": [Function],
-                },
-                "typeCache": Map {},
-              },
-            },
           },
           "path": "path-types/pet.types.ts",
           "repository": Repository {
@@ -651,9 +561,8 @@ class Context {
     "cache": Map {
       "OperationTypeCoder@./petstore.yaml#/paths/~1pet/post@[object Object]:true" => "HTTP_POST",
       "OperationTypeCoder@./petstore.yaml#/paths/~1pet/put@[object Object]:true" => "HTTP_PUT",
-      "ContextCoder@./petstore.yaml#/paths/~1pet/post@paths/$.context.ts:false:true" => "Context",
+      "ContextCoder@paths/$.context.ts:false:true" => "Context",
       "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
-      "ContextCoder@./petstore.yaml#/paths/~1pet/put@paths/$.context.ts:false:true" => "Context2",
     },
     "exports": Map {
       "HTTP_POST" => Object {
@@ -695,7 +604,7 @@ class Context {
       },
       "HTTP_PUT" => Object {
         "beforeExport": "",
-        "code": "({ query, path, header, body, context, proxy }: { query: never, path: never, header: never, body: Pet, context: typeof Context2, response: ResponseBuilderFactory<{
+        "code": "({ query, path, header, body, context, proxy }: { query: never, path: never, header: never, body: Pet, context: typeof Context, response: ResponseBuilderFactory<{
 200: {
           headers: {};
           content: {
@@ -776,7 +685,7 @@ class Context {
 ",
               "code": "new Context()",
               "done": true,
-              "id": "ContextCoder@./petstore.yaml#/paths/~1pet/post",
+              "id": "ContextCoder",
               "isDefault": true,
               "isType": false,
               "name": "Context",
@@ -890,50 +799,6 @@ class Context {
           "typeCache": Map {},
         },
       },
-      "Context2" => Object {
-        "isDefault": true,
-        "isType": false,
-        "name": "Context",
-        "script": Script {
-          "cache": Map {
-            "default" => "Context",
-          },
-          "exports": Map {
-            "Context" => Object {
-              "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/$.context.ts\\";
-  }
-}
-",
-              "code": "new Context()",
-              "done": true,
-              "id": "ContextCoder@./petstore.yaml#/paths/~1pet/post",
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "promise": Promise {},
-              "typeDeclaration": "",
-            },
-          },
-          "externalImports": Map {},
-          "imports": Map {},
-          "path": "paths/$.context.ts",
-          "repository": Repository {
-            "scripts": [Circular],
-            "writeFiles": [Function],
-          },
-          "typeCache": Map {},
-        },
-      },
     },
     "path": "path-types/pet.types.ts",
     "repository": Repository {
@@ -971,7 +836,7 @@ class Context {
         "script": Script {
           "cache": Map {
             "OperationTypeCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get@[object Object]:true" => "HTTP_GET",
-            "ContextCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get@paths/pet/$.context.ts:false:true" => "Context",
+            "ContextCoder@paths/pet/$.context.ts:false:true" => "Context",
             "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
           },
           "exports": Map {
@@ -1048,7 +913,7 @@ class Context {
                       "raw": "export { default } from \\"../$.context.js\\"",
                     },
                     "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get",
+                    "id": "ContextCoder",
                     "isDefault": true,
                     "isType": false,
                     "name": "Context",
@@ -1182,7 +1047,7 @@ class Context {
   "path-types/pet/findByStatus.types.ts" => Script {
     "cache": Map {
       "OperationTypeCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get@[object Object]:true" => "HTTP_GET",
-      "ContextCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get@paths/pet/$.context.ts:false:true" => "Context",
+      "ContextCoder@paths/pet/$.context.ts:false:true" => "Context",
       "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
     },
     "exports": Map {
@@ -1259,7 +1124,7 @@ class Context {
                 "raw": "export { default } from \\"../$.context.js\\"",
               },
               "done": true,
-              "id": "ContextCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get",
+              "id": "ContextCoder",
               "isDefault": true,
               "isType": false,
               "name": "Context",
@@ -1410,7 +1275,7 @@ class Context {
         "script": Script {
           "cache": Map {
             "OperationTypeCoder@./petstore.yaml#/paths/~1pet~1findByTags/get@[object Object]:true" => "HTTP_GET",
-            "ContextCoder@./petstore.yaml#/paths/~1pet~1findByTags/get@paths/pet/$.context.ts:false:true" => "Context",
+            "ContextCoder@paths/pet/$.context.ts:false:true" => "Context",
             "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
           },
           "exports": Map {
@@ -1487,7 +1352,7 @@ class Context {
                       "raw": "export { default } from \\"../$.context.js\\"",
                     },
                     "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get",
+                    "id": "ContextCoder",
                     "isDefault": true,
                     "isType": false,
                     "name": "Context",
@@ -1621,7 +1486,7 @@ class Context {
   "path-types/pet/findByTags.types.ts" => Script {
     "cache": Map {
       "OperationTypeCoder@./petstore.yaml#/paths/~1pet~1findByTags/get@[object Object]:true" => "HTTP_GET",
-      "ContextCoder@./petstore.yaml#/paths/~1pet~1findByTags/get@paths/pet/$.context.ts:false:true" => "Context",
+      "ContextCoder@paths/pet/$.context.ts:false:true" => "Context",
       "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
     },
     "exports": Map {
@@ -1698,7 +1563,7 @@ class Context {
                 "raw": "export { default } from \\"../$.context.js\\"",
               },
               "done": true,
-              "id": "ContextCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get",
+              "id": "ContextCoder",
               "isDefault": true,
               "isType": false,
               "name": "Context",
@@ -1877,10 +1742,8 @@ class Context {
             "OperationTypeCoder@./petstore.yaml#/paths/~1pet~1{petId}/get@[object Object]:true" => "HTTP_GET",
             "OperationTypeCoder@./petstore.yaml#/paths/~1pet~1{petId}/post@[object Object]:true" => "HTTP_POST",
             "OperationTypeCoder@./petstore.yaml#/paths/~1pet~1{petId}/delete@[object Object]:true" => "HTTP_DELETE",
-            "ContextCoder@./petstore.yaml#/paths/~1pet~1{petId}/get@paths/pet/$.context.ts:false:true" => "Context",
+            "ContextCoder@paths/pet/$.context.ts:false:true" => "Context",
             "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
-            "ContextCoder@./petstore.yaml#/paths/~1pet~1{petId}/post@paths/pet/$.context.ts:false:true" => "Context2",
-            "ContextCoder@./petstore.yaml#/paths/~1pet~1{petId}/delete@paths/pet/$.context.ts:false:true" => "Context3",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -1928,7 +1791,7 @@ class Context {
             },
             "HTTP_POST" => Object {
               "beforeExport": "",
-              "code": "({ query, path, header, body, context, proxy }: { query: {name?: number, status?: string}, path: {petId: number}, header: never, body: undefined, context: typeof Context2, response: ResponseBuilderFactory<{
+              "code": "({ query, path, header, body, context, proxy }: { query: {name?: number, status?: string}, path: {petId: number}, header: never, body: undefined, context: typeof Context, response: ResponseBuilderFactory<{
 405: {
           headers: {};
           content: {};
@@ -1946,7 +1809,7 @@ class Context {
             },
             "HTTP_DELETE" => Object {
               "beforeExport": "",
-              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {petId: string}, header: {api_key?: string}, body: undefined, context: typeof Context3, response: ResponseBuilderFactory<{
+              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {petId: string}, header: {api_key?: string}, body: undefined, context: typeof Context, response: ResponseBuilderFactory<{
 400: {
           headers: {};
           content: {};
@@ -1998,7 +1861,7 @@ class Context {
                       "raw": "export { default } from \\"../$.context.js\\"",
                     },
                     "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get",
+                    "id": "ContextCoder",
                     "isDefault": true,
                     "isType": false,
                     "name": "Context",
@@ -2112,98 +1975,6 @@ class Context {
                 "typeCache": Map {},
               },
             },
-            "Context2" => Object {
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "script": Script {
-                "cache": Map {
-                  "default" => "Context",
-                },
-                "exports": Map {
-                  "Context" => Object {
-                    "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/pet/$.context.ts\\";
-  }
-}
-",
-                    "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
-                    },
-                    "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get",
-                    "isDefault": true,
-                    "isType": false,
-                    "name": "Context",
-                    "promise": Promise {},
-                    "typeDeclaration": "",
-                  },
-                },
-                "externalImports": Map {},
-                "imports": Map {},
-                "path": "paths/pet/$.context.ts",
-                "repository": Repository {
-                  "scripts": [Circular],
-                  "writeFiles": [Function],
-                },
-                "typeCache": Map {},
-              },
-            },
-            "Context3" => Object {
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "script": Script {
-                "cache": Map {
-                  "default" => "Context",
-                },
-                "exports": Map {
-                  "Context" => Object {
-                    "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/pet/$.context.ts\\";
-  }
-}
-",
-                    "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
-                    },
-                    "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get",
-                    "isDefault": true,
-                    "isType": false,
-                    "name": "Context",
-                    "promise": Promise {},
-                    "typeDeclaration": "",
-                  },
-                },
-                "externalImports": Map {},
-                "imports": Map {},
-                "path": "paths/pet/$.context.ts",
-                "repository": Repository {
-                  "scripts": [Circular],
-                  "writeFiles": [Function],
-                },
-                "typeCache": Map {},
-              },
-            },
           },
           "path": "path-types/pet/{petId}.types.ts",
           "repository": Repository {
@@ -2222,10 +1993,8 @@ class Context {
             "OperationTypeCoder@./petstore.yaml#/paths/~1pet~1{petId}/get@[object Object]:true" => "HTTP_GET",
             "OperationTypeCoder@./petstore.yaml#/paths/~1pet~1{petId}/post@[object Object]:true" => "HTTP_POST",
             "OperationTypeCoder@./petstore.yaml#/paths/~1pet~1{petId}/delete@[object Object]:true" => "HTTP_DELETE",
-            "ContextCoder@./petstore.yaml#/paths/~1pet~1{petId}/get@paths/pet/$.context.ts:false:true" => "Context",
+            "ContextCoder@paths/pet/$.context.ts:false:true" => "Context",
             "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
-            "ContextCoder@./petstore.yaml#/paths/~1pet~1{petId}/post@paths/pet/$.context.ts:false:true" => "Context2",
-            "ContextCoder@./petstore.yaml#/paths/~1pet~1{petId}/delete@paths/pet/$.context.ts:false:true" => "Context3",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -2273,7 +2042,7 @@ class Context {
             },
             "HTTP_POST" => Object {
               "beforeExport": "",
-              "code": "({ query, path, header, body, context, proxy }: { query: {name?: number, status?: string}, path: {petId: number}, header: never, body: undefined, context: typeof Context2, response: ResponseBuilderFactory<{
+              "code": "({ query, path, header, body, context, proxy }: { query: {name?: number, status?: string}, path: {petId: number}, header: never, body: undefined, context: typeof Context, response: ResponseBuilderFactory<{
 405: {
           headers: {};
           content: {};
@@ -2291,7 +2060,7 @@ class Context {
             },
             "HTTP_DELETE" => Object {
               "beforeExport": "",
-              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {petId: string}, header: {api_key?: string}, body: undefined, context: typeof Context3, response: ResponseBuilderFactory<{
+              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {petId: string}, header: {api_key?: string}, body: undefined, context: typeof Context, response: ResponseBuilderFactory<{
 400: {
           headers: {};
           content: {};
@@ -2343,7 +2112,7 @@ class Context {
                       "raw": "export { default } from \\"../$.context.js\\"",
                     },
                     "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get",
+                    "id": "ContextCoder",
                     "isDefault": true,
                     "isType": false,
                     "name": "Context",
@@ -2457,98 +2226,6 @@ class Context {
                 "typeCache": Map {},
               },
             },
-            "Context2" => Object {
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "script": Script {
-                "cache": Map {
-                  "default" => "Context",
-                },
-                "exports": Map {
-                  "Context" => Object {
-                    "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/pet/$.context.ts\\";
-  }
-}
-",
-                    "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
-                    },
-                    "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get",
-                    "isDefault": true,
-                    "isType": false,
-                    "name": "Context",
-                    "promise": Promise {},
-                    "typeDeclaration": "",
-                  },
-                },
-                "externalImports": Map {},
-                "imports": Map {},
-                "path": "paths/pet/$.context.ts",
-                "repository": Repository {
-                  "scripts": [Circular],
-                  "writeFiles": [Function],
-                },
-                "typeCache": Map {},
-              },
-            },
-            "Context3" => Object {
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "script": Script {
-                "cache": Map {
-                  "default" => "Context",
-                },
-                "exports": Map {
-                  "Context" => Object {
-                    "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/pet/$.context.ts\\";
-  }
-}
-",
-                    "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
-                    },
-                    "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get",
-                    "isDefault": true,
-                    "isType": false,
-                    "name": "Context",
-                    "promise": Promise {},
-                    "typeDeclaration": "",
-                  },
-                },
-                "externalImports": Map {},
-                "imports": Map {},
-                "path": "paths/pet/$.context.ts",
-                "repository": Repository {
-                  "scripts": [Circular],
-                  "writeFiles": [Function],
-                },
-                "typeCache": Map {},
-              },
-            },
           },
           "path": "path-types/pet/{petId}.types.ts",
           "repository": Repository {
@@ -2567,10 +2244,8 @@ class Context {
             "OperationTypeCoder@./petstore.yaml#/paths/~1pet~1{petId}/get@[object Object]:true" => "HTTP_GET",
             "OperationTypeCoder@./petstore.yaml#/paths/~1pet~1{petId}/post@[object Object]:true" => "HTTP_POST",
             "OperationTypeCoder@./petstore.yaml#/paths/~1pet~1{petId}/delete@[object Object]:true" => "HTTP_DELETE",
-            "ContextCoder@./petstore.yaml#/paths/~1pet~1{petId}/get@paths/pet/$.context.ts:false:true" => "Context",
+            "ContextCoder@paths/pet/$.context.ts:false:true" => "Context",
             "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
-            "ContextCoder@./petstore.yaml#/paths/~1pet~1{petId}/post@paths/pet/$.context.ts:false:true" => "Context2",
-            "ContextCoder@./petstore.yaml#/paths/~1pet~1{petId}/delete@paths/pet/$.context.ts:false:true" => "Context3",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -2618,7 +2293,7 @@ class Context {
             },
             "HTTP_POST" => Object {
               "beforeExport": "",
-              "code": "({ query, path, header, body, context, proxy }: { query: {name?: number, status?: string}, path: {petId: number}, header: never, body: undefined, context: typeof Context2, response: ResponseBuilderFactory<{
+              "code": "({ query, path, header, body, context, proxy }: { query: {name?: number, status?: string}, path: {petId: number}, header: never, body: undefined, context: typeof Context, response: ResponseBuilderFactory<{
 405: {
           headers: {};
           content: {};
@@ -2636,7 +2311,7 @@ class Context {
             },
             "HTTP_DELETE" => Object {
               "beforeExport": "",
-              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {petId: string}, header: {api_key?: string}, body: undefined, context: typeof Context3, response: ResponseBuilderFactory<{
+              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {petId: string}, header: {api_key?: string}, body: undefined, context: typeof Context, response: ResponseBuilderFactory<{
 400: {
           headers: {};
           content: {};
@@ -2688,7 +2363,7 @@ class Context {
                       "raw": "export { default } from \\"../$.context.js\\"",
                     },
                     "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get",
+                    "id": "ContextCoder",
                     "isDefault": true,
                     "isType": false,
                     "name": "Context",
@@ -2802,98 +2477,6 @@ class Context {
                 "typeCache": Map {},
               },
             },
-            "Context2" => Object {
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "script": Script {
-                "cache": Map {
-                  "default" => "Context",
-                },
-                "exports": Map {
-                  "Context" => Object {
-                    "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/pet/$.context.ts\\";
-  }
-}
-",
-                    "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
-                    },
-                    "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get",
-                    "isDefault": true,
-                    "isType": false,
-                    "name": "Context",
-                    "promise": Promise {},
-                    "typeDeclaration": "",
-                  },
-                },
-                "externalImports": Map {},
-                "imports": Map {},
-                "path": "paths/pet/$.context.ts",
-                "repository": Repository {
-                  "scripts": [Circular],
-                  "writeFiles": [Function],
-                },
-                "typeCache": Map {},
-              },
-            },
-            "Context3" => Object {
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "script": Script {
-                "cache": Map {
-                  "default" => "Context",
-                },
-                "exports": Map {
-                  "Context" => Object {
-                    "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/pet/$.context.ts\\";
-  }
-}
-",
-                    "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
-                    },
-                    "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get",
-                    "isDefault": true,
-                    "isType": false,
-                    "name": "Context",
-                    "promise": Promise {},
-                    "typeDeclaration": "",
-                  },
-                },
-                "externalImports": Map {},
-                "imports": Map {},
-                "path": "paths/pet/$.context.ts",
-                "repository": Repository {
-                  "scripts": [Circular],
-                  "writeFiles": [Function],
-                },
-                "typeCache": Map {},
-              },
-            },
           },
           "path": "path-types/pet/{petId}.types.ts",
           "repository": Repository {
@@ -2916,10 +2499,8 @@ class Context {
       "OperationTypeCoder@./petstore.yaml#/paths/~1pet~1{petId}/get@[object Object]:true" => "HTTP_GET",
       "OperationTypeCoder@./petstore.yaml#/paths/~1pet~1{petId}/post@[object Object]:true" => "HTTP_POST",
       "OperationTypeCoder@./petstore.yaml#/paths/~1pet~1{petId}/delete@[object Object]:true" => "HTTP_DELETE",
-      "ContextCoder@./petstore.yaml#/paths/~1pet~1{petId}/get@paths/pet/$.context.ts:false:true" => "Context",
+      "ContextCoder@paths/pet/$.context.ts:false:true" => "Context",
       "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
-      "ContextCoder@./petstore.yaml#/paths/~1pet~1{petId}/post@paths/pet/$.context.ts:false:true" => "Context2",
-      "ContextCoder@./petstore.yaml#/paths/~1pet~1{petId}/delete@paths/pet/$.context.ts:false:true" => "Context3",
     },
     "exports": Map {
       "HTTP_GET" => Object {
@@ -2967,7 +2548,7 @@ class Context {
       },
       "HTTP_POST" => Object {
         "beforeExport": "",
-        "code": "({ query, path, header, body, context, proxy }: { query: {name?: number, status?: string}, path: {petId: number}, header: never, body: undefined, context: typeof Context2, response: ResponseBuilderFactory<{
+        "code": "({ query, path, header, body, context, proxy }: { query: {name?: number, status?: string}, path: {petId: number}, header: never, body: undefined, context: typeof Context, response: ResponseBuilderFactory<{
 405: {
           headers: {};
           content: {};
@@ -2985,7 +2566,7 @@ class Context {
       },
       "HTTP_DELETE" => Object {
         "beforeExport": "",
-        "code": "({ query, path, header, body, context, proxy }: { query: never, path: {petId: string}, header: {api_key?: string}, body: undefined, context: typeof Context3, response: ResponseBuilderFactory<{
+        "code": "({ query, path, header, body, context, proxy }: { query: never, path: {petId: string}, header: {api_key?: string}, body: undefined, context: typeof Context, response: ResponseBuilderFactory<{
 400: {
           headers: {};
           content: {};
@@ -3037,7 +2618,7 @@ class Context {
                 "raw": "export { default } from \\"../$.context.js\\"",
               },
               "done": true,
-              "id": "ContextCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get",
+              "id": "ContextCoder",
               "isDefault": true,
               "isType": false,
               "name": "Context",
@@ -3151,98 +2732,6 @@ class Context {
           "typeCache": Map {},
         },
       },
-      "Context2" => Object {
-        "isDefault": true,
-        "isType": false,
-        "name": "Context",
-        "script": Script {
-          "cache": Map {
-            "default" => "Context",
-          },
-          "exports": Map {
-            "Context" => Object {
-              "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/pet/$.context.ts\\";
-  }
-}
-",
-              "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
-              },
-              "done": true,
-              "id": "ContextCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get",
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "promise": Promise {},
-              "typeDeclaration": "",
-            },
-          },
-          "externalImports": Map {},
-          "imports": Map {},
-          "path": "paths/pet/$.context.ts",
-          "repository": Repository {
-            "scripts": [Circular],
-            "writeFiles": [Function],
-          },
-          "typeCache": Map {},
-        },
-      },
-      "Context3" => Object {
-        "isDefault": true,
-        "isType": false,
-        "name": "Context",
-        "script": Script {
-          "cache": Map {
-            "default" => "Context",
-          },
-          "exports": Map {
-            "Context" => Object {
-              "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/pet/$.context.ts\\";
-  }
-}
-",
-              "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
-              },
-              "done": true,
-              "id": "ContextCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get",
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "promise": Promise {},
-              "typeDeclaration": "",
-            },
-          },
-          "externalImports": Map {},
-          "imports": Map {},
-          "path": "paths/pet/$.context.ts",
-          "repository": Repository {
-            "scripts": [Circular],
-            "writeFiles": [Function],
-          },
-          "typeCache": Map {},
-        },
-      },
     },
     "path": "path-types/pet/{petId}.types.ts",
     "repository": Repository {
@@ -3280,7 +2769,7 @@ class Context {
         "script": Script {
           "cache": Map {
             "OperationTypeCoder@./petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post@[object Object]:true" => "HTTP_POST",
-            "ContextCoder@./petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post@paths/pet/{petId}/$.context.ts:false:true" => "Context",
+            "ContextCoder@paths/pet/{petId}/$.context.ts:false:true" => "Context",
             "SchemaTypeCoder@undefined@components/ApiResponse.ts:true:false" => "ApiResponse",
           },
           "exports": Map {
@@ -3344,7 +2833,7 @@ class Context {
                       "raw": "export { default } from \\"../$.context.js\\"",
                     },
                     "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post",
+                    "id": "ContextCoder",
                     "isDefault": true,
                     "isType": false,
                     "name": "Context",
@@ -3413,7 +2902,7 @@ class Context {
   "path-types/pet/{petId}/uploadImage.types.ts" => Script {
     "cache": Map {
       "OperationTypeCoder@./petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post@[object Object]:true" => "HTTP_POST",
-      "ContextCoder@./petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post@paths/pet/{petId}/$.context.ts:false:true" => "Context",
+      "ContextCoder@paths/pet/{petId}/$.context.ts:false:true" => "Context",
       "SchemaTypeCoder@undefined@components/ApiResponse.ts:true:false" => "ApiResponse",
     },
     "exports": Map {
@@ -3477,7 +2966,7 @@ class Context {
                 "raw": "export { default } from \\"../$.context.js\\"",
               },
               "done": true,
-              "id": "ContextCoder@./petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post",
+              "id": "ContextCoder",
               "isDefault": true,
               "isType": false,
               "name": "Context",
@@ -3563,7 +3052,7 @@ class Context {
         "script": Script {
           "cache": Map {
             "OperationTypeCoder@./petstore.yaml#/paths/~1store~1inventory/get@[object Object]:true" => "HTTP_GET",
-            "ContextCoder@./petstore.yaml#/paths/~1store~1inventory/get@paths/store/$.context.ts:false:true" => "Context",
+            "ContextCoder@paths/store/$.context.ts:false:true" => "Context",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -3626,7 +3115,7 @@ class Context {
                       "raw": "export { default } from \\"../$.context.js\\"",
                     },
                     "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1store~1inventory/get",
+                    "id": "ContextCoder",
                     "isDefault": true,
                     "isType": false,
                     "name": "Context",
@@ -3664,7 +3153,7 @@ class Context {
   "path-types/store/inventory.types.ts" => Script {
     "cache": Map {
       "OperationTypeCoder@./petstore.yaml#/paths/~1store~1inventory/get@[object Object]:true" => "HTTP_GET",
-      "ContextCoder@./petstore.yaml#/paths/~1store~1inventory/get@paths/store/$.context.ts:false:true" => "Context",
+      "ContextCoder@paths/store/$.context.ts:false:true" => "Context",
     },
     "exports": Map {
       "HTTP_GET" => Object {
@@ -3727,7 +3216,7 @@ class Context {
                 "raw": "export { default } from \\"../$.context.js\\"",
               },
               "done": true,
-              "id": "ContextCoder@./petstore.yaml#/paths/~1store~1inventory/get",
+              "id": "ContextCoder",
               "isDefault": true,
               "isType": false,
               "name": "Context",
@@ -3782,7 +3271,7 @@ class Context {
         "script": Script {
           "cache": Map {
             "OperationTypeCoder@./petstore.yaml#/paths/~1store~1order/post@[object Object]:true" => "HTTP_POST",
-            "ContextCoder@./petstore.yaml#/paths/~1store~1order/post@paths/store/$.context.ts:false:true" => "Context",
+            "ContextCoder@paths/store/$.context.ts:false:true" => "Context",
             "SchemaTypeCoder@undefined@components/Order.ts:true:false" => "Order",
           },
           "exports": Map {
@@ -3852,7 +3341,7 @@ class Context {
                       "raw": "export { default } from \\"../$.context.js\\"",
                     },
                     "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1store~1inventory/get",
+                    "id": "ContextCoder",
                     "isDefault": true,
                     "isType": false,
                     "name": "Context",
@@ -3921,7 +3410,7 @@ class Context {
   "path-types/store/order.types.ts" => Script {
     "cache": Map {
       "OperationTypeCoder@./petstore.yaml#/paths/~1store~1order/post@[object Object]:true" => "HTTP_POST",
-      "ContextCoder@./petstore.yaml#/paths/~1store~1order/post@paths/store/$.context.ts:false:true" => "Context",
+      "ContextCoder@paths/store/$.context.ts:false:true" => "Context",
       "SchemaTypeCoder@undefined@components/Order.ts:true:false" => "Order",
     },
     "exports": Map {
@@ -3991,7 +3480,7 @@ class Context {
                 "raw": "export { default } from \\"../$.context.js\\"",
               },
               "done": true,
-              "id": "ContextCoder@./petstore.yaml#/paths/~1store~1inventory/get",
+              "id": "ContextCoder",
               "isDefault": true,
               "isType": false,
               "name": "Context",
@@ -4091,9 +3580,8 @@ class Context {
           "cache": Map {
             "OperationTypeCoder@./petstore.yaml#/paths/~1store~1order~1{orderId}/get@[object Object]:true" => "HTTP_GET",
             "OperationTypeCoder@./petstore.yaml#/paths/~1store~1order~1{orderId}/delete@[object Object]:true" => "HTTP_DELETE",
-            "ContextCoder@./petstore.yaml#/paths/~1store~1order~1{orderId}/get@paths/store/order/$.context.ts:false:true" => "Context",
+            "ContextCoder@paths/store/order/$.context.ts:false:true" => "Context",
             "SchemaTypeCoder@undefined@components/Order.ts:true:false" => "Order",
-            "ContextCoder@./petstore.yaml#/paths/~1store~1order~1{orderId}/delete@paths/store/order/$.context.ts:false:true" => "Context2",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -4141,7 +3629,7 @@ class Context {
             },
             "HTTP_DELETE" => Object {
               "beforeExport": "",
-              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {orderId: number}, header: never, body: undefined, context: typeof Context2, response: ResponseBuilderFactory<{
+              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {orderId: number}, header: never, body: undefined, context: typeof Context, response: ResponseBuilderFactory<{
 400: {
           headers: {};
           content: {};
@@ -4199,7 +3687,7 @@ class Context {
                       "raw": "export { default } from \\"../$.context.js\\"",
                     },
                     "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1store~1order~1{orderId}/get",
+                    "id": "ContextCoder",
                     "isDefault": true,
                     "isType": false,
                     "name": "Context",
@@ -4248,52 +3736,6 @@ class Context {
                 "typeCache": Map {},
               },
             },
-            "Context2" => Object {
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "script": Script {
-                "cache": Map {
-                  "default" => "Context",
-                },
-                "exports": Map {
-                  "Context" => Object {
-                    "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/store/order/$.context.ts\\";
-  }
-}
-",
-                    "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
-                    },
-                    "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1store~1order~1{orderId}/get",
-                    "isDefault": true,
-                    "isType": false,
-                    "name": "Context",
-                    "promise": Promise {},
-                    "typeDeclaration": "",
-                  },
-                },
-                "externalImports": Map {},
-                "imports": Map {},
-                "path": "paths/store/order/$.context.ts",
-                "repository": Repository {
-                  "scripts": [Circular],
-                  "writeFiles": [Function],
-                },
-                "typeCache": Map {},
-              },
-            },
           },
           "path": "path-types/store/order/{orderId}.types.ts",
           "repository": Repository {
@@ -4311,9 +3753,8 @@ class Context {
           "cache": Map {
             "OperationTypeCoder@./petstore.yaml#/paths/~1store~1order~1{orderId}/get@[object Object]:true" => "HTTP_GET",
             "OperationTypeCoder@./petstore.yaml#/paths/~1store~1order~1{orderId}/delete@[object Object]:true" => "HTTP_DELETE",
-            "ContextCoder@./petstore.yaml#/paths/~1store~1order~1{orderId}/get@paths/store/order/$.context.ts:false:true" => "Context",
+            "ContextCoder@paths/store/order/$.context.ts:false:true" => "Context",
             "SchemaTypeCoder@undefined@components/Order.ts:true:false" => "Order",
-            "ContextCoder@./petstore.yaml#/paths/~1store~1order~1{orderId}/delete@paths/store/order/$.context.ts:false:true" => "Context2",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -4361,7 +3802,7 @@ class Context {
             },
             "HTTP_DELETE" => Object {
               "beforeExport": "",
-              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {orderId: number}, header: never, body: undefined, context: typeof Context2, response: ResponseBuilderFactory<{
+              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {orderId: number}, header: never, body: undefined, context: typeof Context, response: ResponseBuilderFactory<{
 400: {
           headers: {};
           content: {};
@@ -4419,7 +3860,7 @@ class Context {
                       "raw": "export { default } from \\"../$.context.js\\"",
                     },
                     "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1store~1order~1{orderId}/get",
+                    "id": "ContextCoder",
                     "isDefault": true,
                     "isType": false,
                     "name": "Context",
@@ -4468,52 +3909,6 @@ class Context {
                 "typeCache": Map {},
               },
             },
-            "Context2" => Object {
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "script": Script {
-                "cache": Map {
-                  "default" => "Context",
-                },
-                "exports": Map {
-                  "Context" => Object {
-                    "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/store/order/$.context.ts\\";
-  }
-}
-",
-                    "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
-                    },
-                    "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1store~1order~1{orderId}/get",
-                    "isDefault": true,
-                    "isType": false,
-                    "name": "Context",
-                    "promise": Promise {},
-                    "typeDeclaration": "",
-                  },
-                },
-                "externalImports": Map {},
-                "imports": Map {},
-                "path": "paths/store/order/$.context.ts",
-                "repository": Repository {
-                  "scripts": [Circular],
-                  "writeFiles": [Function],
-                },
-                "typeCache": Map {},
-              },
-            },
           },
           "path": "path-types/store/order/{orderId}.types.ts",
           "repository": Repository {
@@ -4535,9 +3930,8 @@ class Context {
     "cache": Map {
       "OperationTypeCoder@./petstore.yaml#/paths/~1store~1order~1{orderId}/get@[object Object]:true" => "HTTP_GET",
       "OperationTypeCoder@./petstore.yaml#/paths/~1store~1order~1{orderId}/delete@[object Object]:true" => "HTTP_DELETE",
-      "ContextCoder@./petstore.yaml#/paths/~1store~1order~1{orderId}/get@paths/store/order/$.context.ts:false:true" => "Context",
+      "ContextCoder@paths/store/order/$.context.ts:false:true" => "Context",
       "SchemaTypeCoder@undefined@components/Order.ts:true:false" => "Order",
-      "ContextCoder@./petstore.yaml#/paths/~1store~1order~1{orderId}/delete@paths/store/order/$.context.ts:false:true" => "Context2",
     },
     "exports": Map {
       "HTTP_GET" => Object {
@@ -4585,7 +3979,7 @@ class Context {
       },
       "HTTP_DELETE" => Object {
         "beforeExport": "",
-        "code": "({ query, path, header, body, context, proxy }: { query: never, path: {orderId: number}, header: never, body: undefined, context: typeof Context2, response: ResponseBuilderFactory<{
+        "code": "({ query, path, header, body, context, proxy }: { query: never, path: {orderId: number}, header: never, body: undefined, context: typeof Context, response: ResponseBuilderFactory<{
 400: {
           headers: {};
           content: {};
@@ -4643,7 +4037,7 @@ class Context {
                 "raw": "export { default } from \\"../$.context.js\\"",
               },
               "done": true,
-              "id": "ContextCoder@./petstore.yaml#/paths/~1store~1order~1{orderId}/get",
+              "id": "ContextCoder",
               "isDefault": true,
               "isType": false,
               "name": "Context",
@@ -4692,52 +4086,6 @@ class Context {
           "typeCache": Map {},
         },
       },
-      "Context2" => Object {
-        "isDefault": true,
-        "isType": false,
-        "name": "Context",
-        "script": Script {
-          "cache": Map {
-            "default" => "Context",
-          },
-          "exports": Map {
-            "Context" => Object {
-              "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/store/order/$.context.ts\\";
-  }
-}
-",
-              "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
-              },
-              "done": true,
-              "id": "ContextCoder@./petstore.yaml#/paths/~1store~1order~1{orderId}/get",
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "promise": Promise {},
-              "typeDeclaration": "",
-            },
-          },
-          "externalImports": Map {},
-          "imports": Map {},
-          "path": "paths/store/order/$.context.ts",
-          "repository": Repository {
-            "scripts": [Circular],
-            "writeFiles": [Function],
-          },
-          "typeCache": Map {},
-        },
-      },
     },
     "path": "path-types/store/order/{orderId}.types.ts",
     "repository": Repository {
@@ -4775,7 +4123,7 @@ class Context {
         "script": Script {
           "cache": Map {
             "OperationTypeCoder@./petstore.yaml#/paths/~1user/post@[object Object]:true" => "HTTP_POST",
-            "ContextCoder@./petstore.yaml#/paths/~1user/post@paths/$.context.ts:false:true" => "Context",
+            "ContextCoder@paths/$.context.ts:false:true" => "Context",
             "SchemaTypeCoder@undefined@components/User.ts:true:false" => "User",
           },
           "exports": Map {
@@ -4844,7 +4192,7 @@ class Context {
 ",
                     "code": "new Context()",
                     "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1pet/post",
+                    "id": "ContextCoder",
                     "isDefault": true,
                     "isType": false,
                     "name": "Context",
@@ -4913,7 +4261,7 @@ class Context {
   "path-types/user.types.ts" => Script {
     "cache": Map {
       "OperationTypeCoder@./petstore.yaml#/paths/~1user/post@[object Object]:true" => "HTTP_POST",
-      "ContextCoder@./petstore.yaml#/paths/~1user/post@paths/$.context.ts:false:true" => "Context",
+      "ContextCoder@paths/$.context.ts:false:true" => "Context",
       "SchemaTypeCoder@undefined@components/User.ts:true:false" => "User",
     },
     "exports": Map {
@@ -4982,7 +4330,7 @@ class Context {
 ",
               "code": "new Context()",
               "done": true,
-              "id": "ContextCoder@./petstore.yaml#/paths/~1pet/post",
+              "id": "ContextCoder",
               "isDefault": true,
               "isType": false,
               "name": "Context",
@@ -5068,7 +4416,7 @@ class Context {
         "script": Script {
           "cache": Map {
             "OperationTypeCoder@./petstore.yaml#/paths/~1user~1createWithList/post@[object Object]:true" => "HTTP_POST",
-            "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post@paths/user/$.context.ts:false:true" => "Context",
+            "ContextCoder@paths/user/$.context.ts:false:true" => "Context",
             "SchemaTypeCoder@undefined@components/User.ts:true:false" => "User",
           },
           "exports": Map {
@@ -5145,7 +4493,7 @@ class Context {
                       "raw": "export { default } from \\"../$.context.js\\"",
                     },
                     "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post",
+                    "id": "ContextCoder",
                     "isDefault": true,
                     "isType": false,
                     "name": "Context",
@@ -5214,7 +4562,7 @@ class Context {
   "path-types/user/createWithList.types.ts" => Script {
     "cache": Map {
       "OperationTypeCoder@./petstore.yaml#/paths/~1user~1createWithList/post@[object Object]:true" => "HTTP_POST",
-      "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post@paths/user/$.context.ts:false:true" => "Context",
+      "ContextCoder@paths/user/$.context.ts:false:true" => "Context",
       "SchemaTypeCoder@undefined@components/User.ts:true:false" => "User",
     },
     "exports": Map {
@@ -5291,7 +4639,7 @@ class Context {
                 "raw": "export { default } from \\"../$.context.js\\"",
               },
               "done": true,
-              "id": "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post",
+              "id": "ContextCoder",
               "isDefault": true,
               "isType": false,
               "name": "Context",
@@ -5377,7 +4725,7 @@ class Context {
         "script": Script {
           "cache": Map {
             "OperationTypeCoder@./petstore.yaml#/paths/~1user~1login/get@[object Object]:true" => "HTTP_GET",
-            "ContextCoder@./petstore.yaml#/paths/~1user~1login/get@paths/user/$.context.ts:false:true" => "Context",
+            "ContextCoder@paths/user/$.context.ts:false:true" => "Context",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -5456,7 +4804,7 @@ class Context {
                       "raw": "export { default } from \\"../$.context.js\\"",
                     },
                     "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post",
+                    "id": "ContextCoder",
                     "isDefault": true,
                     "isType": false,
                     "name": "Context",
@@ -5494,7 +4842,7 @@ class Context {
   "path-types/user/login.types.ts" => Script {
     "cache": Map {
       "OperationTypeCoder@./petstore.yaml#/paths/~1user~1login/get@[object Object]:true" => "HTTP_GET",
-      "ContextCoder@./petstore.yaml#/paths/~1user~1login/get@paths/user/$.context.ts:false:true" => "Context",
+      "ContextCoder@paths/user/$.context.ts:false:true" => "Context",
     },
     "exports": Map {
       "HTTP_GET" => Object {
@@ -5573,7 +4921,7 @@ class Context {
                 "raw": "export { default } from \\"../$.context.js\\"",
               },
               "done": true,
-              "id": "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post",
+              "id": "ContextCoder",
               "isDefault": true,
               "isType": false,
               "name": "Context",
@@ -5626,7 +4974,7 @@ class Context {
         "script": Script {
           "cache": Map {
             "OperationTypeCoder@./petstore.yaml#/paths/~1user~1logout/get@[object Object]:true" => "HTTP_GET",
-            "ContextCoder@./petstore.yaml#/paths/~1user~1logout/get@paths/user/$.context.ts:false:true" => "Context",
+            "ContextCoder@paths/user/$.context.ts:false:true" => "Context",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -5683,7 +5031,7 @@ class Context {
                       "raw": "export { default } from \\"../$.context.js\\"",
                     },
                     "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post",
+                    "id": "ContextCoder",
                     "isDefault": true,
                     "isType": false,
                     "name": "Context",
@@ -5721,7 +5069,7 @@ class Context {
   "path-types/user/logout.types.ts" => Script {
     "cache": Map {
       "OperationTypeCoder@./petstore.yaml#/paths/~1user~1logout/get@[object Object]:true" => "HTTP_GET",
-      "ContextCoder@./petstore.yaml#/paths/~1user~1logout/get@paths/user/$.context.ts:false:true" => "Context",
+      "ContextCoder@paths/user/$.context.ts:false:true" => "Context",
     },
     "exports": Map {
       "HTTP_GET" => Object {
@@ -5778,7 +5126,7 @@ class Context {
                 "raw": "export { default } from \\"../$.context.js\\"",
               },
               "done": true,
-              "id": "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post",
+              "id": "ContextCoder",
               "isDefault": true,
               "isType": false,
               "name": "Context",
@@ -5861,10 +5209,8 @@ class Context {
             "OperationTypeCoder@./petstore.yaml#/paths/~1user~1{username}/get@[object Object]:true" => "HTTP_GET",
             "OperationTypeCoder@./petstore.yaml#/paths/~1user~1{username}/put@[object Object]:true" => "HTTP_PUT",
             "OperationTypeCoder@./petstore.yaml#/paths/~1user~1{username}/delete@[object Object]:true" => "HTTP_DELETE",
-            "ContextCoder@./petstore.yaml#/paths/~1user~1{username}/get@paths/user/$.context.ts:false:true" => "Context",
+            "ContextCoder@paths/user/$.context.ts:false:true" => "Context",
             "SchemaTypeCoder@undefined@components/User.ts:true:false" => "User",
-            "ContextCoder@./petstore.yaml#/paths/~1user~1{username}/put@paths/user/$.context.ts:false:true" => "Context2",
-            "ContextCoder@./petstore.yaml#/paths/~1user~1{username}/delete@paths/user/$.context.ts:false:true" => "Context3",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -5912,7 +5258,7 @@ class Context {
             },
             "HTTP_PUT" => Object {
               "beforeExport": "",
-              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {username: string}, header: never, body: User, context: typeof Context2, response: ResponseBuilderFactory<{
+              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {username: string}, header: never, body: User, context: typeof Context, response: ResponseBuilderFactory<{
 [statusCode in HttpStatusCode]: {
           headers: {};
           content: {};
@@ -5930,7 +5276,7 @@ class Context {
             },
             "HTTP_DELETE" => Object {
               "beforeExport": "",
-              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {username: string}, header: never, body: undefined, context: typeof Context3, response: ResponseBuilderFactory<{
+              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {username: string}, header: never, body: undefined, context: typeof Context, response: ResponseBuilderFactory<{
 400: {
           headers: {};
           content: {};
@@ -5988,7 +5334,7 @@ class Context {
                       "raw": "export { default } from \\"../$.context.js\\"",
                     },
                     "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post",
+                    "id": "ContextCoder",
                     "isDefault": true,
                     "isType": false,
                     "name": "Context",
@@ -6037,98 +5383,6 @@ class Context {
                 "typeCache": Map {},
               },
             },
-            "Context2" => Object {
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "script": Script {
-                "cache": Map {
-                  "default" => "Context",
-                },
-                "exports": Map {
-                  "Context" => Object {
-                    "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/user/$.context.ts\\";
-  }
-}
-",
-                    "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
-                    },
-                    "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post",
-                    "isDefault": true,
-                    "isType": false,
-                    "name": "Context",
-                    "promise": Promise {},
-                    "typeDeclaration": "",
-                  },
-                },
-                "externalImports": Map {},
-                "imports": Map {},
-                "path": "paths/user/$.context.ts",
-                "repository": Repository {
-                  "scripts": [Circular],
-                  "writeFiles": [Function],
-                },
-                "typeCache": Map {},
-              },
-            },
-            "Context3" => Object {
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "script": Script {
-                "cache": Map {
-                  "default" => "Context",
-                },
-                "exports": Map {
-                  "Context" => Object {
-                    "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/user/$.context.ts\\";
-  }
-}
-",
-                    "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
-                    },
-                    "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post",
-                    "isDefault": true,
-                    "isType": false,
-                    "name": "Context",
-                    "promise": Promise {},
-                    "typeDeclaration": "",
-                  },
-                },
-                "externalImports": Map {},
-                "imports": Map {},
-                "path": "paths/user/$.context.ts",
-                "repository": Repository {
-                  "scripts": [Circular],
-                  "writeFiles": [Function],
-                },
-                "typeCache": Map {},
-              },
-            },
           },
           "path": "path-types/user/{username}.types.ts",
           "repository": Repository {
@@ -6147,10 +5401,8 @@ class Context {
             "OperationTypeCoder@./petstore.yaml#/paths/~1user~1{username}/get@[object Object]:true" => "HTTP_GET",
             "OperationTypeCoder@./petstore.yaml#/paths/~1user~1{username}/put@[object Object]:true" => "HTTP_PUT",
             "OperationTypeCoder@./petstore.yaml#/paths/~1user~1{username}/delete@[object Object]:true" => "HTTP_DELETE",
-            "ContextCoder@./petstore.yaml#/paths/~1user~1{username}/get@paths/user/$.context.ts:false:true" => "Context",
+            "ContextCoder@paths/user/$.context.ts:false:true" => "Context",
             "SchemaTypeCoder@undefined@components/User.ts:true:false" => "User",
-            "ContextCoder@./petstore.yaml#/paths/~1user~1{username}/put@paths/user/$.context.ts:false:true" => "Context2",
-            "ContextCoder@./petstore.yaml#/paths/~1user~1{username}/delete@paths/user/$.context.ts:false:true" => "Context3",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -6198,7 +5450,7 @@ class Context {
             },
             "HTTP_PUT" => Object {
               "beforeExport": "",
-              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {username: string}, header: never, body: User, context: typeof Context2, response: ResponseBuilderFactory<{
+              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {username: string}, header: never, body: User, context: typeof Context, response: ResponseBuilderFactory<{
 [statusCode in HttpStatusCode]: {
           headers: {};
           content: {};
@@ -6216,7 +5468,7 @@ class Context {
             },
             "HTTP_DELETE" => Object {
               "beforeExport": "",
-              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {username: string}, header: never, body: undefined, context: typeof Context3, response: ResponseBuilderFactory<{
+              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {username: string}, header: never, body: undefined, context: typeof Context, response: ResponseBuilderFactory<{
 400: {
           headers: {};
           content: {};
@@ -6274,7 +5526,7 @@ class Context {
                       "raw": "export { default } from \\"../$.context.js\\"",
                     },
                     "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post",
+                    "id": "ContextCoder",
                     "isDefault": true,
                     "isType": false,
                     "name": "Context",
@@ -6323,98 +5575,6 @@ class Context {
                 "typeCache": Map {},
               },
             },
-            "Context2" => Object {
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "script": Script {
-                "cache": Map {
-                  "default" => "Context",
-                },
-                "exports": Map {
-                  "Context" => Object {
-                    "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/user/$.context.ts\\";
-  }
-}
-",
-                    "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
-                    },
-                    "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post",
-                    "isDefault": true,
-                    "isType": false,
-                    "name": "Context",
-                    "promise": Promise {},
-                    "typeDeclaration": "",
-                  },
-                },
-                "externalImports": Map {},
-                "imports": Map {},
-                "path": "paths/user/$.context.ts",
-                "repository": Repository {
-                  "scripts": [Circular],
-                  "writeFiles": [Function],
-                },
-                "typeCache": Map {},
-              },
-            },
-            "Context3" => Object {
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "script": Script {
-                "cache": Map {
-                  "default" => "Context",
-                },
-                "exports": Map {
-                  "Context" => Object {
-                    "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/user/$.context.ts\\";
-  }
-}
-",
-                    "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
-                    },
-                    "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post",
-                    "isDefault": true,
-                    "isType": false,
-                    "name": "Context",
-                    "promise": Promise {},
-                    "typeDeclaration": "",
-                  },
-                },
-                "externalImports": Map {},
-                "imports": Map {},
-                "path": "paths/user/$.context.ts",
-                "repository": Repository {
-                  "scripts": [Circular],
-                  "writeFiles": [Function],
-                },
-                "typeCache": Map {},
-              },
-            },
           },
           "path": "path-types/user/{username}.types.ts",
           "repository": Repository {
@@ -6433,10 +5593,8 @@ class Context {
             "OperationTypeCoder@./petstore.yaml#/paths/~1user~1{username}/get@[object Object]:true" => "HTTP_GET",
             "OperationTypeCoder@./petstore.yaml#/paths/~1user~1{username}/put@[object Object]:true" => "HTTP_PUT",
             "OperationTypeCoder@./petstore.yaml#/paths/~1user~1{username}/delete@[object Object]:true" => "HTTP_DELETE",
-            "ContextCoder@./petstore.yaml#/paths/~1user~1{username}/get@paths/user/$.context.ts:false:true" => "Context",
+            "ContextCoder@paths/user/$.context.ts:false:true" => "Context",
             "SchemaTypeCoder@undefined@components/User.ts:true:false" => "User",
-            "ContextCoder@./petstore.yaml#/paths/~1user~1{username}/put@paths/user/$.context.ts:false:true" => "Context2",
-            "ContextCoder@./petstore.yaml#/paths/~1user~1{username}/delete@paths/user/$.context.ts:false:true" => "Context3",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -6484,7 +5642,7 @@ class Context {
             },
             "HTTP_PUT" => Object {
               "beforeExport": "",
-              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {username: string}, header: never, body: User, context: typeof Context2, response: ResponseBuilderFactory<{
+              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {username: string}, header: never, body: User, context: typeof Context, response: ResponseBuilderFactory<{
 [statusCode in HttpStatusCode]: {
           headers: {};
           content: {};
@@ -6502,7 +5660,7 @@ class Context {
             },
             "HTTP_DELETE" => Object {
               "beforeExport": "",
-              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {username: string}, header: never, body: undefined, context: typeof Context3, response: ResponseBuilderFactory<{
+              "code": "({ query, path, header, body, context, proxy }: { query: never, path: {username: string}, header: never, body: undefined, context: typeof Context, response: ResponseBuilderFactory<{
 400: {
           headers: {};
           content: {};
@@ -6560,7 +5718,7 @@ class Context {
                       "raw": "export { default } from \\"../$.context.js\\"",
                     },
                     "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post",
+                    "id": "ContextCoder",
                     "isDefault": true,
                     "isType": false,
                     "name": "Context",
@@ -6609,98 +5767,6 @@ class Context {
                 "typeCache": Map {},
               },
             },
-            "Context2" => Object {
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "script": Script {
-                "cache": Map {
-                  "default" => "Context",
-                },
-                "exports": Map {
-                  "Context" => Object {
-                    "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/user/$.context.ts\\";
-  }
-}
-",
-                    "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
-                    },
-                    "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post",
-                    "isDefault": true,
-                    "isType": false,
-                    "name": "Context",
-                    "promise": Promise {},
-                    "typeDeclaration": "",
-                  },
-                },
-                "externalImports": Map {},
-                "imports": Map {},
-                "path": "paths/user/$.context.ts",
-                "repository": Repository {
-                  "scripts": [Circular],
-                  "writeFiles": [Function],
-                },
-                "typeCache": Map {},
-              },
-            },
-            "Context3" => Object {
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "script": Script {
-                "cache": Map {
-                  "default" => "Context",
-                },
-                "exports": Map {
-                  "Context" => Object {
-                    "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/user/$.context.ts\\";
-  }
-}
-",
-                    "code": Object {
-                      "raw": "export { default } from \\"../$.context.js\\"",
-                    },
-                    "done": true,
-                    "id": "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post",
-                    "isDefault": true,
-                    "isType": false,
-                    "name": "Context",
-                    "promise": Promise {},
-                    "typeDeclaration": "",
-                  },
-                },
-                "externalImports": Map {},
-                "imports": Map {},
-                "path": "paths/user/$.context.ts",
-                "repository": Repository {
-                  "scripts": [Circular],
-                  "writeFiles": [Function],
-                },
-                "typeCache": Map {},
-              },
-            },
           },
           "path": "path-types/user/{username}.types.ts",
           "repository": Repository {
@@ -6723,10 +5789,8 @@ class Context {
       "OperationTypeCoder@./petstore.yaml#/paths/~1user~1{username}/get@[object Object]:true" => "HTTP_GET",
       "OperationTypeCoder@./petstore.yaml#/paths/~1user~1{username}/put@[object Object]:true" => "HTTP_PUT",
       "OperationTypeCoder@./petstore.yaml#/paths/~1user~1{username}/delete@[object Object]:true" => "HTTP_DELETE",
-      "ContextCoder@./petstore.yaml#/paths/~1user~1{username}/get@paths/user/$.context.ts:false:true" => "Context",
+      "ContextCoder@paths/user/$.context.ts:false:true" => "Context",
       "SchemaTypeCoder@undefined@components/User.ts:true:false" => "User",
-      "ContextCoder@./petstore.yaml#/paths/~1user~1{username}/put@paths/user/$.context.ts:false:true" => "Context2",
-      "ContextCoder@./petstore.yaml#/paths/~1user~1{username}/delete@paths/user/$.context.ts:false:true" => "Context3",
     },
     "exports": Map {
       "HTTP_GET" => Object {
@@ -6774,7 +5838,7 @@ class Context {
       },
       "HTTP_PUT" => Object {
         "beforeExport": "",
-        "code": "({ query, path, header, body, context, proxy }: { query: never, path: {username: string}, header: never, body: User, context: typeof Context2, response: ResponseBuilderFactory<{
+        "code": "({ query, path, header, body, context, proxy }: { query: never, path: {username: string}, header: never, body: User, context: typeof Context, response: ResponseBuilderFactory<{
 [statusCode in HttpStatusCode]: {
           headers: {};
           content: {};
@@ -6792,7 +5856,7 @@ class Context {
       },
       "HTTP_DELETE" => Object {
         "beforeExport": "",
-        "code": "({ query, path, header, body, context, proxy }: { query: never, path: {username: string}, header: never, body: undefined, context: typeof Context3, response: ResponseBuilderFactory<{
+        "code": "({ query, path, header, body, context, proxy }: { query: never, path: {username: string}, header: never, body: undefined, context: typeof Context, response: ResponseBuilderFactory<{
 400: {
           headers: {};
           content: {};
@@ -6850,7 +5914,7 @@ class Context {
                 "raw": "export { default } from \\"../$.context.js\\"",
               },
               "done": true,
-              "id": "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post",
+              "id": "ContextCoder",
               "isDefault": true,
               "isType": false,
               "name": "Context",
@@ -6899,98 +5963,6 @@ class Context {
           "typeCache": Map {},
         },
       },
-      "Context2" => Object {
-        "isDefault": true,
-        "isType": false,
-        "name": "Context",
-        "script": Script {
-          "cache": Map {
-            "default" => "Context",
-          },
-          "exports": Map {
-            "Context" => Object {
-              "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/user/$.context.ts\\";
-  }
-}
-",
-              "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
-              },
-              "done": true,
-              "id": "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post",
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "promise": Promise {},
-              "typeDeclaration": "",
-            },
-          },
-          "externalImports": Map {},
-          "imports": Map {},
-          "path": "paths/user/$.context.ts",
-          "repository": Repository {
-            "scripts": [Circular],
-            "writeFiles": [Function],
-          },
-          "typeCache": Map {},
-        },
-      },
-      "Context3" => Object {
-        "isDefault": true,
-        "isType": false,
-        "name": "Context",
-        "script": Script {
-          "cache": Map {
-            "default" => "Context",
-          },
-          "exports": Map {
-            "Context" => Object {
-              "beforeExport": "/**
-* This is the default context for Counterfact.
-* Change the code to suit your needs.
-*/
-class Context {
-  // delete this line to make the class type safe
-  [key: string]: any; 
-
-  // A helper when you accessing the context object via the REPL. You can delete it if you like.
-  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
-    return inspect(this, { ...options, customInspect: false }) + \\"\\\\n\\\\n ^ This is the default context object. You can edit its definition at paths/user/$.context.ts\\";
-  }
-}
-",
-              "code": Object {
-                "raw": "export { default } from \\"../$.context.js\\"",
-              },
-              "done": true,
-              "id": "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post",
-              "isDefault": true,
-              "isType": false,
-              "name": "Context",
-              "promise": Promise {},
-              "typeDeclaration": "",
-            },
-          },
-          "externalImports": Map {},
-          "imports": Map {},
-          "path": "paths/user/$.context.ts",
-          "repository": Repository {
-            "scripts": [Circular],
-            "writeFiles": [Function],
-          },
-          "typeCache": Map {},
-        },
-      },
     },
     "path": "path-types/user/{username}.types.ts",
     "repository": Repository {
@@ -7021,7 +5993,7 @@ class Context {
 ",
         "code": "new Context()",
         "done": true,
-        "id": "ContextCoder@./petstore.yaml#/paths/~1pet/post",
+        "id": "ContextCoder",
         "isDefault": true,
         "isType": false,
         "name": "Context",
@@ -7153,7 +6125,7 @@ class Context {
           "raw": "export { default } from \\"../$.context.js\\"",
         },
         "done": true,
-        "id": "ContextCoder@./petstore.yaml#/paths/~1pet~1findByStatus/get",
+        "id": "ContextCoder",
         "isDefault": true,
         "isType": false,
         "name": "Context",
@@ -7194,7 +6166,7 @@ class Context {
           "raw": "export { default } from \\"../$.context.js\\"",
         },
         "done": true,
-        "id": "ContextCoder@./petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post",
+        "id": "ContextCoder",
         "isDefault": true,
         "isType": false,
         "name": "Context",
@@ -7261,7 +6233,7 @@ class Context {
           "raw": "export { default } from \\"../$.context.js\\"",
         },
         "done": true,
-        "id": "ContextCoder@./petstore.yaml#/paths/~1store~1inventory/get",
+        "id": "ContextCoder",
         "isDefault": true,
         "isType": false,
         "name": "Context",
@@ -7328,7 +6300,7 @@ class Context {
           "raw": "export { default } from \\"../$.context.js\\"",
         },
         "done": true,
-        "id": "ContextCoder@./petstore.yaml#/paths/~1store~1order~1{orderId}/get",
+        "id": "ContextCoder",
         "isDefault": true,
         "isType": false,
         "name": "Context",
@@ -7395,7 +6367,7 @@ class Context {
           "raw": "export { default } from \\"../$.context.js\\"",
         },
         "done": true,
-        "id": "ContextCoder@./petstore.yaml#/paths/~1user~1createWithList/post",
+        "id": "ContextCoder",
         "isDefault": true,
         "isType": false,
         "name": "Context",
diff --git a/test/typescript-generator/context-coder.test.js b/test/typescript-generator/context-coder.test.js
new file mode 100644
index 0000000..1e69643
--- /dev/null
+++ b/test/typescript-generator/context-coder.test.js
@@ -0,0 +1,71 @@
+/* eslint-disable jest/no-restricted-matchers */
+import prettier from "prettier";
+
+import { ContextCoder } from "../../src/typescript-generator/context-coder.js";
+import { Requirement } from "../../src/typescript-generator/requirement.js";
+
+function format(code) {
+  return prettier.format(code, { parser: "typescript" });
+}
+
+const dummyScript = {
+  path: ".",
+
+  importDefault() {
+    return "default";
+  },
+
+  importExternalType() {
+    return "ExternalType";
+  },
+
+  importType() {
+    return "Type";
+  },
+
+  import() {
+    return "schema";
+  },
+
+  repository: {
+    get() {
+      return {
+        exportDefault() {
+          return "noop";
+        },
+      };
+    },
+  },
+};
+
+describe("a ContextCoder", () => {
+  it("generates a list of potential names", () => {
+    const coder = new ContextCoder({ url: "#/components/schemas/Person" });
+
+    const [one, two, three] = coder.names();
+
+    expect([one, two, three]).toStrictEqual([
+      "Context",
+      "Context2",
+      "Context3",
+    ]);
+  });
+
+  it("when asked to delegate an inline requirement, returns itself", async () => {
+    const coder = new ContextCoder(new Requirement({ type: "string" }));
+
+    await expect(coder.delegate()).resolves.toBe(coder);
+  });
+
+  it("has a static ID", () => {
+    const coder = new ContextCoder({ url: "#/paths/hello/get" });
+
+    expect(coder.id).toBe("ContextCoder");
+  });
+
+  it("finds the request method in the URL", () => {
+    const coder = new ContextCoder(new Requirement({}, "#/paths/hello/get"));
+
+    expect(format(coder.write(dummyScript).raw)).toMatchSnapshot();
+  });
+});