Repository: pmcelhaney/counterfact
Pull request #209 (2022-09-24 16:18:29)

156 export context from path files
Each directory under `/paths/` has a file called `$context.js`.

The file exports an object of some kind. In most cases it will be a pointer to the context defined in the parent directory (`export { default } from  "../context.js";`).


The idea is to build a rich context object so the code looks something like this.

```ts
class MyContext {
   name:string = "Counterfact";

   speak(message: string) {
      return `${this.name} says "${message}"`; 
   }
}

export default new MyContext();
```

That context object is then passed into the operation functions.

```ts
export const GET = ({context}) => {
   return context.speak("hello world");
}

export const POST= ({context, body}) => {
   context.name = body.name;
}
```

TypeScript knows the type of the context object so you get auto-completion and type safety.

It supports hot reloading. So if you change the `$context.ts` file the changes will be picked up immediately without restarting. 

To do:

- [x] use default export (because I might use named exports later to provide models for specific paths)
- [x] export a class and have Counterfact instantiate it (so that the class can also function as a type)
- [x] generate base `#model.ts` file
- [x] generate `#model.ts` files in subdirectories
- [x] reference the type from `#model.ts` in files under `path-types`
- [x] the `#model.ts` file in a subdirectory should reference its parent
- [x] rename model to context


Patch:
diff --git a/.changeset/shaggy-cars-impress.md b/.changeset/shaggy-cars-impress.md
new file mode 100644
index 0000000..eefef35
--- /dev/null
+++ b/.changeset/shaggy-cars-impress.md
@@ -0,0 +1,5 @@
+---
+"counterfact": minor
+---
+
+new $context.ts files which are used to define the server context / state
diff --git a/src/context-registry.js b/src/context-registry.js
new file mode 100644
index 0000000..9efa820
--- /dev/null
+++ b/src/context-registry.js
@@ -0,0 +1,38 @@
+export function parentPath(path) {
+  return String(path.split("/").slice(0, -1).join("/")) || "/";
+}
+
+export class ContextRegistry {
+  entries = new Map();
+
+  constructor() {
+    this.add("/", {});
+  }
+
+  add(path, context) {
+    if (context === undefined) {
+      throw new Error("context cannot be undefined");
+    }
+
+    this.entries.set(path, context);
+  }
+
+  find(path) {
+    return this.entries.get(path) ?? this.find(parentPath(path));
+  }
+
+  update(path, updatedContext) {
+    const context = this.find(path);
+
+    for (const property in updatedContext) {
+      if (
+        Object.prototype.hasOwnProperty.call(updatedContext, property) &&
+        !Object.prototype.hasOwnProperty.call(context, property)
+      ) {
+        context[property] = updatedContext[property];
+      }
+    }
+
+    Object.setPrototypeOf(context, Object.getPrototypeOf(updatedContext));
+  }
+}
diff --git a/src/counterfact.js b/src/counterfact.js
index 370759b..4b96770 100644
--- a/src/counterfact.js
+++ b/src/counterfact.js
@@ -12,6 +12,7 @@ import { Dispatcher } from "./dispatcher.js";
 import { koaMiddleware } from "./koa-middleware.js";
 import { ModuleLoader } from "./module-loader.js";
 import { Transpiler } from "./transpiler.js";
+import { ContextRegistry } from "./context-registry.js";
 
 async function loadOpenApiDocument(source) {
   try {
@@ -24,12 +25,11 @@ async function loadOpenApiDocument(source) {
 // eslint-disable-next-line max-statements
 export async function counterfact(
   basePath,
-  context = {},
   openApiPath = nodePath.join(basePath, "../openapi.yaml")
 ) {
   const openApiDocument = await loadOpenApiDocument(openApiPath);
 
-  const registry = new Registry(context);
+  const registry = new Registry();
 
   const modulesPath = `${await fs.mkdtemp(
     nodePath.join(os.tmpdir(), "counterfact-")
@@ -48,10 +48,13 @@ export async function counterfact(
 
   await transpiler.watch();
 
-  const dispatcher = new Dispatcher(registry, openApiDocument);
+  const contextRegistry = new ContextRegistry();
+
+  const dispatcher = new Dispatcher(registry, contextRegistry, openApiDocument);
   const moduleLoader = new ModuleLoader(
     nodePath.join(modulesPath, "paths"),
-    registry
+    registry,
+    contextRegistry
   );
 
   await moduleLoader.load();
diff --git a/src/dispatcher.js b/src/dispatcher.js
index 573c185..05d72b3 100644
--- a/src/dispatcher.js
+++ b/src/dispatcher.js
@@ -6,8 +6,9 @@ import { Tools } from "./tools.js";
 export class Dispatcher {
   registry;
 
-  constructor(registry, openApiDocument) {
+  constructor(registry, contextRegistry, openApiDocument) {
     this.registry = registry;
+    this.contextRegistry = contextRegistry;
     this.openApiDocument = openApiDocument;
   }
 
@@ -24,6 +25,7 @@ export class Dispatcher {
       body,
       query,
       headers,
+      context: this.contextRegistry.find(path),
 
       response: createResponseBuilder(
         this.operationForPathAndMethod(
diff --git a/src/module-loader.js b/src/module-loader.js
index afbfec9..f641dae 100644
--- a/src/module-loader.js
+++ b/src/module-loader.js
@@ -5,6 +5,8 @@ import { once } from "node:events";
 
 import chokidar from "chokidar";
 
+import { ContextRegistry } from "./context-registry.js";
+
 export class ModuleLoader extends EventTarget {
   basePath;
 
@@ -12,10 +14,13 @@ export class ModuleLoader extends EventTarget {
 
   watcher;
 
-  constructor(basePath, registry) {
+  contextRegistry;
+
+  constructor(basePath, registry, contextRegistry = new ContextRegistry()) {
     super();
     this.basePath = basePath;
     this.registry = registry;
+    this.contextRegistry = contextRegistry;
   }
 
   async watch() {
@@ -31,10 +36,6 @@ export class ModuleLoader extends EventTarget {
           `/${nodePath.join(parts.dir, parts.name)}`
         );
 
-        if (parts.name.includes("#")) {
-          return;
-        }
-
         if (eventName === "unlink") {
           this.registry.remove(url);
           this.dispatchEvent(new Event("remove"), pathName);
@@ -44,10 +45,17 @@ export class ModuleLoader extends EventTarget {
         import(`${pathName}?cacheBust=${Date.now()}`)
           // eslint-disable-next-line promise/prefer-await-to-then
           .then((endpoint) => {
-            this.registry.add(url, endpoint);
             this.dispatchEvent(new Event(eventName), pathName);
 
-            return "ok";
+            if (pathName.includes("$context")) {
+              this.contextRegistry.update(parts.dir, endpoint.default);
+
+              return "context";
+            }
+
+            this.registry.add(url, endpoint);
+
+            return "path";
           })
           // eslint-disable-next-line promise/prefer-await-to-then
           .catch((error) => {
@@ -71,10 +79,6 @@ export class ModuleLoader extends EventTarget {
     });
 
     const imports = files.flatMap(async (file) => {
-      if (file.name.includes("#")) {
-        return;
-      }
-
       const extension = file.name.split(".").at(-1);
 
       if (file.isDirectory()) {
@@ -92,10 +96,14 @@ export class ModuleLoader extends EventTarget {
         nodePath.join(this.basePath, directory, file.name)
       );
 
-      this.registry.add(
-        `/${nodePath.join(directory, nodePath.parse(file.name).name)}`,
-        endpoint
-      );
+      if (file.name.includes("$context")) {
+        this.contextRegistry.add(`/${directory}`, endpoint.default);
+      } else {
+        this.registry.add(
+          `/${nodePath.join(directory, nodePath.parse(file.name).name)}`,
+          endpoint
+        );
+      }
     });
 
     await Promise.all(imports);
diff --git a/src/registry.js b/src/registry.js
index 35c5644..5ab403a 100644
--- a/src/registry.js
+++ b/src/registry.js
@@ -5,12 +5,6 @@ export class Registry {
     children: {},
   };
 
-  context;
-
-  constructor(context = {}) {
-    this.context = context;
-  }
-
   add(url, module) {
     let node = this.moduleTree;
 
@@ -89,7 +83,6 @@ export class Registry {
     return ({ ...requestData }) =>
       execute({
         ...requestData,
-        context: this.context,
         path: handler.path,
         matchedPath: handler.matchedPath ?? "none",
       });
diff --git a/src/start.js b/src/start.js
index 5f49d45..be1ebca 100644
--- a/src/start.js
+++ b/src/start.js
@@ -12,14 +12,11 @@ export async function start(
   port = DEFAULT_PORT,
   openApiPath = nodePath.join(basePath, "../openapi.yaml")
 ) {
-  // eslint-disable-next-line import/no-unresolved, node/no-unsupported-features/es-syntax
-  const context = await import("./context/context.js").catch(() => ({}));
-
   const app = new Koa();
 
   app.use(bodyParser());
 
-  const { koaMiddleware } = await counterfact(basePath, context, openApiPath);
+  const { koaMiddleware } = await counterfact(basePath, openApiPath);
 
   app.use(koaMiddleware);
 
diff --git a/src/typescript-generator/context-coder.js b/src/typescript-generator/context-coder.js
new file mode 100644
index 0000000..50e5bca
--- /dev/null
+++ b/src/typescript-generator/context-coder.js
@@ -0,0 +1,33 @@
+import nodePath from "node:path";
+
+import { Coder } from "./coder.js";
+
+export class ContextCoder extends Coder {
+  isRoot() {
+    return this.requirement.url.split("/").at(-2).split("~1").length === 2;
+  }
+
+  names() {
+    return super.names("Context");
+  }
+
+  write() {
+    if (this.isRoot()) {
+      return "{}";
+    }
+
+    return { raw: 'export { default } from "../$context.js"' };
+  }
+
+  modulePath() {
+    const pathString = this.requirement.url
+      .split("/")
+      .at(-2)
+      .replaceAll("~1", "/");
+
+    return `${nodePath.join(
+      "paths",
+      nodePath.dirname(pathString)
+    )}/$context.ts`;
+  }
+}
diff --git a/src/typescript-generator/operation-type-coder.js b/src/typescript-generator/operation-type-coder.js
index c2e9f7d..8092ad2 100644
--- a/src/typescript-generator/operation-type-coder.js
+++ b/src/typescript-generator/operation-type-coder.js
@@ -5,6 +5,7 @@ import { ToolsCoder } from "./tools-coder.js";
 import { SchemaTypeCoder } from "./schema-type-coder.js";
 import { ParametersTypeCoder } from "./parameters-type-coder.js";
 import { ResponseTypeCoder } from "./response-type-coder.js";
+import { ContextCoder } from "./context-coder.js";
 
 export class OperationTypeCoder extends Coder {
   names() {
@@ -67,9 +68,8 @@ export class OperationTypeCoder extends Coder {
   }
 
   write(script) {
-    script.importExternalType(
-      "Context",
-      nodePath.relative(nodePath.dirname(script.path), "context/context.js")
+    const contextImportName = script.importDefault(
+      new ContextCoder(this.requirement)
     );
 
     const parameters = this.requirement.get("parameters");
@@ -100,7 +100,7 @@ export class OperationTypeCoder extends Coder {
       this.requirement.get("responses")
     ).write(script);
 
-    return `({ query, path, header, body, context, tools }: { query: ${queryType}, path: ${pathType}, header: ${headerType}, body: ${bodyType}, context: Context, response: ${responseType}, tools: ${script.importType(
+    return `({ query, path, header, body, context, tools }: { query: ${queryType}, path: ${pathType}, header: ${headerType}, body: ${bodyType}, context: ${contextImportName}, response: ${responseType}, tools: ${script.importType(
       new ToolsCoder(),
       "internal/tools.ts"
     )}}) => ${this.responseTypes(
diff --git a/src/typescript-generator/repository.js b/src/typescript-generator/repository.js
index 6d720da..71e2bee 100644
--- a/src/typescript-generator/repository.js
+++ b/src/typescript-generator/repository.js
@@ -65,7 +65,7 @@ export class Repository {
             .then((stat) => stat.isFile())
             .catch(() => false))
         ) {
-          process.stdout.write(`not overwriting${fullPath}\n`);
+          process.stdout.write(`not overwriting ${fullPath}\n`);
 
           return;
         }
diff --git a/src/typescript-generator/script.js b/src/typescript-generator/script.js
index 241cd76..d72f6b3 100644
--- a/src/typescript-generator/script.js
+++ b/src/typescript-generator/script.js
@@ -21,8 +21,10 @@ export class Script {
     throw new Error(`could not find a unique name for ${coder.id}`);
   }
 
-  export(coder, isType = false) {
-    const cacheKey = `${coder.id}@${nodePath}:${isType}`;
+  export(coder, isType = false, isDefault = false) {
+    const cacheKey = isDefault
+      ? "default"
+      : `${coder.id}@${nodePath}:${isType}`;
 
     if (this.cache.has(cacheKey)) {
       return this.cache.get(cacheKey);
@@ -36,6 +38,7 @@ export class Script {
       id: coder.id,
       done: false,
       isType,
+      isDefault,
       typeDeclaration: coder.typeDeclaration(this.exports, this),
     };
 
@@ -63,11 +66,14 @@ export class Script {
     return name;
   }
 
-  // eslint-disable-next-line max-statements
-  import(coder, isType = false) {
+  exportDefault(coder, isType = false) {
+    this.export(coder, isType, true);
+  }
+
+  import(coder, isType = false, isDefault = false) {
     const modulePath = coder.modulePath();
 
-    const cacheKey = `${coder.id}@${modulePath}:${isType}`;
+    const cacheKey = `${coder.id}@${modulePath}:${isType}:${isDefault}`;
 
     if (this.cache.has(cacheKey)) {
       return this.cache.get(cacheKey);
@@ -77,18 +83,19 @@ export class Script {
 
     this.cache.set(cacheKey, name);
 
-    if (name === "get") {
-      throw new Error(`name not working, ${coder.names().next().value}`);
-    }
-
     const scriptFromWhichToExport = this.repository.get(modulePath);
 
-    const exportedName = scriptFromWhichToExport.export(coder, isType);
+    const exportedName = scriptFromWhichToExport.export(
+      coder,
+      isType,
+      isDefault
+    );
 
     this.imports.set(name, {
       script: scriptFromWhichToExport,
       name: exportedName,
       isType,
+      isDefault,
     });
 
     return name;
@@ -98,6 +105,10 @@ export class Script {
     return this.import(coder, true);
   }
 
+  importDefault(coder, isType = true) {
+    return this.import(coder, isType, true);
+  }
+
   importExternal(name, modulePath, isType = false) {
     this.externalImports.set(name, { modulePath, isType });
 
@@ -127,16 +138,20 @@ export class Script {
   externalImportsStatements() {
     return Array.from(
       this.externalImports,
-      ([name, { modulePath, isType }]) =>
-        `import${isType ? " type" : ""} { ${name} } from "${modulePath}";`
+      ([name, { modulePath, isType, isDefault }]) =>
+        `import${isType ? " type" : ""} ${
+          isDefault ? name : `{ ${name} }`
+        } from "${modulePath}";`
     );
   }
 
   importStatements() {
     return Array.from(
       this.imports,
-      ([name, { script, isType }]) =>
-        `import${isType ? " type" : ""} { ${name} } from "./${nodePath.relative(
+      ([name, { script, isType, isDefault }]) =>
+        `import${isType ? " type" : ""} ${
+          isDefault ? name : `{ ${name} }`
+        } from "./${nodePath.relative(
           nodePath.dirname(this.path),
           script.path.replace(/\.ts$/u, ".js")
         )}";`
@@ -146,7 +161,15 @@ export class Script {
   exportStatements() {
     return Array.from(
       this.exports.values(),
-      ({ name, isType, code, typeDeclaration }) => {
+      ({ name, isType, isDefault, code, typeDeclaration }) => {
+        if (code.raw) {
+          return code.raw;
+        }
+
+        if (isDefault) {
+          return `export default ${code};`;
+        }
+
         const keyword = isType ? "type" : "const";
         const typeAnnotation =
           typeDeclaration.length === 0 ? "" : `:${typeDeclaration}`;


Test patch:
diff --git a/test/context-registry.test.js b/test/context-registry.test.js
new file mode 100644
index 0000000..2713737
--- /dev/null
+++ b/test/context-registry.test.js
@@ -0,0 +1,82 @@
+import { ContextRegistry, parentPath } from "../src/context-registry.js";
+
+describe("moduleRegistry", () => {
+  it("finds a context that exactly matches the path", () => {
+    const helloContext = { name: "hello" };
+
+    const registry = new ContextRegistry();
+
+    registry.add("/hello", helloContext);
+
+    expect(registry.find("/hello")).toBe(helloContext);
+  });
+
+  it("finds a context at a parent path", () => {
+    const helloContext = { name: "hello" };
+
+    const registry = new ContextRegistry();
+
+    registry.add("/hello", helloContext);
+
+    expect(registry.find("/hello/world")).toBe(helloContext);
+  });
+
+  it("returns an empty object when there is no matching context", () => {
+    const helloContext = { name: "hello" };
+
+    const registry = new ContextRegistry();
+
+    registry.add("/hello", helloContext);
+
+    expect(registry.find("/goodbye/world")).toStrictEqual({});
+  });
+
+  it("updates an existing context by changing methods but not properties", () => {
+    class SingleContext {
+      constructor() {
+        this.count = 0;
+      }
+
+      increment() {
+        this.count += 1;
+      }
+    }
+
+    class DoubleContext {
+      constructor() {
+        this.count = 0;
+      }
+
+      increment() {
+        this.count += 2;
+      }
+    }
+
+    const originalContext = new SingleContext();
+
+    const registry = new ContextRegistry();
+
+    registry.add("/", originalContext);
+    originalContext.increment();
+
+    expect(registry.find("/").count).toBe(1);
+
+    registry.update("/", new DoubleContext());
+
+    expect(registry.find("/").count).toBe(1);
+
+    originalContext.increment();
+
+    expect(registry.find("/").count).toBe(3);
+  });
+});
+
+describe("parentPath()", () => {
+  it("returns the parent path", () => {
+    expect(parentPath("/hello/world")).toBe("/hello");
+  });
+
+  it("returns '/' when the path is at the root", () => {
+    expect(parentPath("/hello")).toBe("/");
+  });
+});
diff --git a/test/counterfact.test.js b/test/counterfact.test.js
index 9b66a61..a2d5ba5 100644
--- a/test/counterfact.test.js
+++ b/test/counterfact.test.js
@@ -44,32 +44,6 @@ describe("integration test", () => {
     });
   });
 
-  it("loads the initial context", async () => {
-    const app = new Koa();
-    const request = supertest(app.callback());
-    const files = {
-      "paths/hello.mjs": `
-        export async function GET({context}) {
-          return await Promise.resolve({ body: "Hello " + context.name });
-        }
-      `,
-    };
-
-    await withTemporaryFiles(files, async (basePath) => {
-      const { koaMiddleware, moduleLoader } = await counterfact(basePath, {
-        name: "World",
-      });
-
-      app.use(koaMiddleware);
-
-      const getResponse = await request.get("/hello");
-
-      expect(getResponse.text).toBe("Hello World");
-
-      await moduleLoader.stopWatching();
-    });
-  });
-
   it("uses an OpenAPI document to generate a random response", async () => {
     const app = new Koa();
     const request = supertest(app.callback());
@@ -106,7 +80,6 @@ describe("integration test", () => {
     await withTemporaryFiles(files, async (basePath) => {
       const { koaMiddleware, moduleLoader } = await counterfact(
         basePath,
-        { name: "World" },
         `${basePath}/openapi.yaml`
       );
 
diff --git a/test/dispatcher.test.js b/test/dispatcher.test.js
index c81dcd7..af88fc4 100644
--- a/test/dispatcher.test.js
+++ b/test/dispatcher.test.js
@@ -1,4 +1,5 @@
 import { Dispatcher } from "../src/dispatcher.js";
+import { ContextRegistry } from "../src/context-registry.js";
 import { Registry } from "../src/registry.js";
 
 describe("a dispatcher", () => {
@@ -13,7 +14,7 @@ describe("a dispatcher", () => {
       },
     });
 
-    const dispatcher = new Dispatcher(registry);
+    const dispatcher = new Dispatcher(registry, new ContextRegistry());
     const response = await dispatcher.request({
       method: "GET",
       path: "/hello",
@@ -31,7 +32,7 @@ describe("a dispatcher", () => {
       },
     });
 
-    const dispatcher = new Dispatcher(registry);
+    const dispatcher = new Dispatcher(registry, new ContextRegistry());
     const response = await dispatcher.request({
       method: "GET",
       path: "/hello",
@@ -75,7 +76,7 @@ describe("a dispatcher", () => {
       },
     });
 
-    const dispatcher = new Dispatcher(registry);
+    const dispatcher = new Dispatcher(registry, new ContextRegistry());
     const response = await dispatcher.request({
       method: "GET",
       path: "/hello",
@@ -135,7 +136,7 @@ describe("a dispatcher", () => {
       },
     });
 
-    const dispatcher = new Dispatcher(registry);
+    const dispatcher = new Dispatcher(registry, new ContextRegistry());
     const html = await dispatcher.request({
       method: "GET",
       path: "/hello",
@@ -164,7 +165,7 @@ describe("a dispatcher", () => {
       },
     });
 
-    const dispatcher = new Dispatcher(registry);
+    const dispatcher = new Dispatcher(registry, new ContextRegistry());
     const response = await dispatcher.request({
       method: "GET",
       path: "/a",
@@ -190,7 +191,7 @@ describe("a dispatcher", () => {
       },
     });
 
-    const dispatcher = new Dispatcher(registry);
+    const dispatcher = new Dispatcher(registry, new ContextRegistry());
 
     const authHeader = {
       Authorization: `Bearer: ${mockedJWT}`,
@@ -218,7 +219,7 @@ describe("a dispatcher", () => {
       },
     });
 
-    const dispatcher = new Dispatcher(registry);
+    const dispatcher = new Dispatcher(registry, new ContextRegistry());
     const response = await dispatcher.request({
       method: "GET",
       path: "/a",
@@ -240,7 +241,7 @@ describe("a dispatcher", () => {
       },
     });
 
-    const dispatcher = new Dispatcher(registry);
+    const dispatcher = new Dispatcher(registry, new ContextRegistry());
     const htmlResponse = await dispatcher.request({
       method: "GET",
       path: "/a",
@@ -273,7 +274,7 @@ describe("a dispatcher", () => {
       },
     });
 
-    const dispatcher = new Dispatcher(registry);
+    const dispatcher = new Dispatcher(registry, new ContextRegistry());
     const htmlResponse = await dispatcher.request({
       method: "GET",
       path: "/a",
@@ -316,7 +317,11 @@ describe("a dispatcher", () => {
       },
     };
 
-    const dispatcher = new Dispatcher(registry, openApiDocument);
+    const dispatcher = new Dispatcher(
+      registry,
+      new ContextRegistry(),
+      openApiDocument
+    );
     const htmlResponse = await dispatcher.request({
       method: "GET",
       path: "/a",
@@ -341,7 +346,7 @@ describe("a dispatcher", () => {
       },
     });
 
-    const dispatcher = new Dispatcher(registry);
+    const dispatcher = new Dispatcher(registry, new ContextRegistry());
     const response = await dispatcher.request({
       method: "PUT",
       path: "/stuff",
@@ -351,7 +356,11 @@ describe("a dispatcher", () => {
   });
 
   it("allows the context object to be mutated directly", async () => {
-    const registry = new Registry({ value: 0 });
+    const registry = new Registry();
+    const contextRegistry = new ContextRegistry();
+    const rootContext = { value: 0 };
+
+    contextRegistry.add("/", rootContext);
 
     registry.add("/increment/{value}", {
       GET({ context, path }) {
@@ -363,7 +372,7 @@ describe("a dispatcher", () => {
       },
     });
 
-    const dispatcher = new Dispatcher(registry);
+    const dispatcher = new Dispatcher(registry, contextRegistry);
 
     const result = await dispatcher.request({
       method: "GET",
@@ -373,7 +382,7 @@ describe("a dispatcher", () => {
 
     expect(result.body).toBe("incremented");
 
-    expect(registry.context.value).toBe(1);
+    expect(rootContext.value).toBe(1);
 
     await dispatcher.request({
       method: "GET",
@@ -381,7 +390,28 @@ describe("a dispatcher", () => {
       body: "",
     });
 
-    expect(registry.context.value).toBe(3);
+    expect(rootContext.value).toBe(3);
+  });
+
+  it("passes a context object", async () => {
+    const registry = new Registry();
+    const contextRegistry = new ContextRegistry();
+
+    contextRegistry.add("/", "test context");
+    registry.add("/echo", {
+      GET({ context }) {
+        return { body: context };
+      },
+    });
+
+    const dispatcher = new Dispatcher(registry, contextRegistry);
+
+    const result = await dispatcher.request({
+      method: "GET",
+      path: "/echo",
+    });
+
+    expect(result.body).toBe("test context");
   });
 });
 
@@ -398,7 +428,7 @@ describe("given an invalid path", () => {
       },
     });
 
-    const dispatcher = new Dispatcher(registry);
+    const dispatcher = new Dispatcher(registry, new ContextRegistry());
 
     const response = await dispatcher.request({
       method: "PUT",
diff --git a/test/koa-middleware.test.js b/test/koa-middleware.test.js
index 8e1d41d..658446c 100644
--- a/test/koa-middleware.test.js
+++ b/test/koa-middleware.test.js
@@ -1,6 +1,7 @@
 import { Registry } from "../src/registry.js";
 import { Dispatcher } from "../src/dispatcher.js";
 import { koaMiddleware } from "../src/koa-middleware.js";
+import { ContextRegistry } from "../src/context-registry.js";
 
 describe("koa middleware", () => {
   it("passes the request to the dispatcher and returns the response", async () => {
@@ -14,7 +15,7 @@ describe("koa middleware", () => {
       },
     });
 
-    const dispatcher = new Dispatcher(registry);
+    const dispatcher = new Dispatcher(registry, new ContextRegistry());
     const middleware = koaMiddleware(dispatcher);
     const ctx = {
       request: { path: "/hello", method: "POST", body: { name: "Homer" } },
@@ -37,7 +38,7 @@ describe("koa middleware", () => {
       },
     });
 
-    const dispatcher = new Dispatcher(registry);
+    const dispatcher = new Dispatcher(registry, new ContextRegistry());
     const middleware = koaMiddleware(dispatcher);
     const ctx = {
       request: { path: "/not-modified", method: "GET" },
diff --git a/test/lib/with-temporary-files.js b/test/lib/with-temporary-files.js
index 713b70c..06ec0e7 100644
--- a/test/lib/with-temporary-files.js
+++ b/test/lib/with-temporary-files.js
@@ -3,6 +3,8 @@ import { constants as fsConstants } from "node:fs";
 import os from "node:os";
 import nodePath from "node:path";
 
+const DEBUG = false;
+
 async function ensureDirectoryExists(filePath) {
   const directory = nodePath.dirname(filePath);
 
@@ -40,8 +42,12 @@ function createRemoveFunction(basePath) {
 }
 
 export async function withTemporaryFiles(files, ...callbacks) {
+  const baseDirectory = DEBUG
+    ? nodePath.resolve(process.cwd(), "./")
+    : os.tmpdir();
+
   const temporaryDirectory = `${await fs.mkdtemp(
-    nodePath.join(os.tmpdir(), "wtf-")
+    nodePath.join(baseDirectory, "wtf-")
   )}/`;
 
   try {
@@ -68,8 +74,8 @@ export async function withTemporaryFiles(files, ...callbacks) {
       });
     }
   } finally {
-    await fs.rm(temporaryDirectory, {
-      recursive: true,
-    });
+    if (!DEBUG) {
+      await fs.rm(temporaryDirectory, { recursive: true });
+    }
   }
 }
diff --git a/test/module-loader.test.js b/test/module-loader.test.js
index f2ccff2..6be6770 100644
--- a/test/module-loader.test.js
+++ b/test/module-loader.test.js
@@ -2,6 +2,7 @@ import { once } from "node:events";
 
 import { ModuleLoader } from "../src/module-loader.js";
 import { Registry } from "../src/registry.js";
+import { ContextRegistry } from "../src/context-registry.js";
 
 import { withTemporaryFiles } from "./lib/with-temporary-files.js";
 
@@ -90,7 +91,6 @@ describe("a module loader", () => {
     const files = {
       "module.mjs": contents,
       "README.md": contents,
-      "#types.mjs": contents,
     };
 
     await withTemporaryFiles(files, async (basePath, { add }) => {
@@ -101,10 +101,9 @@ describe("a module loader", () => {
       await loader.watch();
 
       await add("other.txt", "should not be loaded");
-      await add("#other.mjs", "should not be loaded");
 
       expect(registry.exists("GET", "/module")).toBe(true);
-      expect(registry.exists("GET", "/README")).toBe(false);
+      expect(registry.exists("GET", "/READMEx")).toBe(false);
       expect(registry.exists("GET", "/other")).toBe(false);
       expect(registry.exists("GET", "/types")).toBe(false);
 
@@ -146,4 +145,25 @@ describe("a module loader", () => {
       }
     );
   });
+
+  it("finds a context and adds it to the context registry", async () => {
+    const files = {
+      "$context.mjs": 'export default "main"',
+      "hello/$context.mjs": 'export default "hello"',
+    };
+
+    await withTemporaryFiles(files, async (basePath) => {
+      const registry = new Registry();
+
+      const contextRegistry = new ContextRegistry();
+
+      const loader = new ModuleLoader(basePath, registry, contextRegistry);
+
+      await loader.load();
+
+      expect(contextRegistry.find("/hello")).toBe("hello");
+      expect(contextRegistry.find("/hello/world")).toBe("hello");
+      expect(contextRegistry.find("/some/other/path")).toBe("main");
+    });
+  });
 });
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 3ca924f..35adaa4 100644
--- a/test/typescript-generator/__snapshots__/end-to-end.test.js.snap
+++ b/test/typescript-generator/__snapshots__/end-to-end.test.js.snap
@@ -5,9 +5,9 @@ Map {
   "paths/pet.ts" => Script {
     "cache": Map {
       "OperationCoder@petstore.yaml#/paths/~1pet/post@[object Object]:false" => "POST",
-      "OperationTypeCoder@petstore.yaml#/paths/~1pet/post@path-types/pet.types.ts:true" => "HTTP_POST",
+      "OperationTypeCoder@petstore.yaml#/paths/~1pet/post@path-types/pet.types.ts:true:false" => "HTTP_POST",
       "OperationCoder@petstore.yaml#/paths/~1pet/put@[object Object]:false" => "PUT",
-      "OperationTypeCoder@petstore.yaml#/paths/~1pet/put@path-types/pet.types.ts:true" => "HTTP_PUT",
+      "OperationTypeCoder@petstore.yaml#/paths/~1pet/put@path-types/pet.types.ts:true:false" => "HTTP_PUT",
     },
     "exports": Map {
       "POST" => Object {
@@ -16,6 +16,7 @@ Map {
     }",
         "done": true,
         "id": "OperationCoder@petstore.yaml#/paths/~1pet/post",
+        "isDefault": false,
         "isType": false,
         "name": "POST",
         "promise": Promise {},
@@ -27,6 +28,7 @@ Map {
     }",
         "done": true,
         "id": "OperationCoder@petstore.yaml#/paths/~1pet/put",
+        "isDefault": false,
         "isType": false,
         "name": "PUT",
         "promise": Promise {},
@@ -36,14 +38,17 @@ Map {
     "externalImports": Map {},
     "imports": Map {
       "HTTP_POST" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_POST",
         "script": Script {
           "cache": Map {
             "OperationTypeCoder@petstore.yaml#/paths/~1pet/post@[object Object]:true" => "HTTP_POST",
             "OperationTypeCoder@petstore.yaml#/paths/~1pet/put@[object Object]:true" => "HTTP_PUT",
-            "SchemaTypeCoder@undefined@components/Pet.ts:true" => "Pet",
-            "tools@internal/tools.ts:true" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1pet/post@paths//$context.ts:true:true" => "Context",
+            "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
+            "tools@internal/tools.ts:true:false" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1pet/put@paths//$context.ts:true:true" => "Context2",
           },
           "exports": Map {
             "HTTP_POST" => Object {
@@ -83,13 +88,14 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet/post",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_POST",
               "promise": Promise {},
               "typeDeclaration": "",
             },
             "HTTP_PUT" => Object {
-              "code": "({ query, path, header, body, context, tools }: { query: undefined, path: undefined, header: undefined, body: Pet, context: Context, response: ResponseBuilderBuilder<{
+              "code": "({ query, path, header, body, context, tools }: { query: undefined, path: undefined, header: undefined, body: Pet, context: Context2, response: ResponseBuilderBuilder<{
       200: {
           headers: {};
           content: {
@@ -145,6 +151,7 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet/put",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_PUT",
               "promise": Promise {},
@@ -152,10 +159,6 @@ Map {
             },
           },
           "externalImports": Map {
-            "Context" => Object {
-              "isType": true,
-              "modulePath": "../context/context.js",
-            },
             "ResponseBuilderBuilder" => Object {
               "isType": true,
               "modulePath": "counterfact",
@@ -166,20 +169,52 @@ Map {
             },
           },
           "imports": Map {
+            "Context" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": "{}",
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1pet/post",
+                    "isDefault": true,
+                    "isType": true,
+                    "name": "Context",
+                    "promise": Promise {},
+                    "typeDeclaration": "",
+                  },
+                },
+                "externalImports": Map {},
+                "imports": Map {},
+                "path": "paths//$context.ts",
+                "repository": Repository {
+                  "scripts": [Circular],
+                  "writeFiles": [Function],
+                },
+                "typeCache": Map {},
+              },
+            },
             "Pet" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Pet",
               "script": Script {
                 "cache": Map {
                   "SchemaTypeCoder@undefined@[object Object]:true" => "Pet",
-                  "SchemaTypeCoder@undefined@components/Category.ts:true" => "Category",
-                  "SchemaTypeCoder@undefined@components/Tag.ts:true" => "Tag",
+                  "SchemaTypeCoder@undefined@components/Category.ts:true:false" => "Category",
+                  "SchemaTypeCoder@undefined@components/Tag.ts:true:false" => "Tag",
                 },
                 "exports": Map {
                   "Pet" => Object {
                     "code": "{id?: number,name: string,category?: Category,photoUrls: Array<string>,tags?: Array<Tag>,status?: string}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Pet",
                     "promise": Promise {},
@@ -189,6 +224,7 @@ Map {
                 "externalImports": Map {},
                 "imports": Map {
                   "Category" => Object {
+                    "isDefault": false,
                     "isType": true,
                     "name": "Category",
                     "script": Script {
@@ -200,6 +236,7 @@ Map {
                           "code": "{id?: number,name?: string}",
                           "done": true,
                           "id": "SchemaTypeCoder@undefined",
+                          "isDefault": false,
                           "isType": true,
                           "name": "Category",
                           "promise": Promise {},
@@ -217,6 +254,7 @@ Map {
                     },
                   },
                   "Tag" => Object {
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tag",
                     "script": Script {
@@ -228,6 +266,7 @@ Map {
                           "code": "{id?: number,name?: string}",
                           "done": true,
                           "id": "SchemaTypeCoder@undefined",
+                          "isDefault": false,
                           "isType": true,
                           "name": "Tag",
                           "promise": Promise {},
@@ -254,6 +293,7 @@ Map {
               },
             },
             "Tools" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "script": Script {
@@ -270,6 +310,7 @@ Map {
     }",
                     "done": true,
                     "id": "tools",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tools",
                     "promise": Promise {},
@@ -291,6 +332,36 @@ Map {
                 "typeCache": Map {},
               },
             },
+            "Context2" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": "{}",
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1pet/post",
+                    "isDefault": true,
+                    "isType": true,
+                    "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 {
@@ -301,14 +372,17 @@ Map {
         },
       },
       "HTTP_PUT" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_PUT",
         "script": Script {
           "cache": Map {
             "OperationTypeCoder@petstore.yaml#/paths/~1pet/post@[object Object]:true" => "HTTP_POST",
             "OperationTypeCoder@petstore.yaml#/paths/~1pet/put@[object Object]:true" => "HTTP_PUT",
-            "SchemaTypeCoder@undefined@components/Pet.ts:true" => "Pet",
-            "tools@internal/tools.ts:true" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1pet/post@paths//$context.ts:true:true" => "Context",
+            "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
+            "tools@internal/tools.ts:true:false" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1pet/put@paths//$context.ts:true:true" => "Context2",
           },
           "exports": Map {
             "HTTP_POST" => Object {
@@ -348,13 +422,14 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet/post",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_POST",
               "promise": Promise {},
               "typeDeclaration": "",
             },
             "HTTP_PUT" => Object {
-              "code": "({ query, path, header, body, context, tools }: { query: undefined, path: undefined, header: undefined, body: Pet, context: Context, response: ResponseBuilderBuilder<{
+              "code": "({ query, path, header, body, context, tools }: { query: undefined, path: undefined, header: undefined, body: Pet, context: Context2, response: ResponseBuilderBuilder<{
       200: {
           headers: {};
           content: {
@@ -410,6 +485,7 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet/put",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_PUT",
               "promise": Promise {},
@@ -417,10 +493,6 @@ Map {
             },
           },
           "externalImports": Map {
-            "Context" => Object {
-              "isType": true,
-              "modulePath": "../context/context.js",
-            },
             "ResponseBuilderBuilder" => Object {
               "isType": true,
               "modulePath": "counterfact",
@@ -431,20 +503,52 @@ Map {
             },
           },
           "imports": Map {
+            "Context" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": "{}",
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1pet/post",
+                    "isDefault": true,
+                    "isType": true,
+                    "name": "Context",
+                    "promise": Promise {},
+                    "typeDeclaration": "",
+                  },
+                },
+                "externalImports": Map {},
+                "imports": Map {},
+                "path": "paths//$context.ts",
+                "repository": Repository {
+                  "scripts": [Circular],
+                  "writeFiles": [Function],
+                },
+                "typeCache": Map {},
+              },
+            },
             "Pet" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Pet",
               "script": Script {
                 "cache": Map {
                   "SchemaTypeCoder@undefined@[object Object]:true" => "Pet",
-                  "SchemaTypeCoder@undefined@components/Category.ts:true" => "Category",
-                  "SchemaTypeCoder@undefined@components/Tag.ts:true" => "Tag",
+                  "SchemaTypeCoder@undefined@components/Category.ts:true:false" => "Category",
+                  "SchemaTypeCoder@undefined@components/Tag.ts:true:false" => "Tag",
                 },
                 "exports": Map {
                   "Pet" => Object {
                     "code": "{id?: number,name: string,category?: Category,photoUrls: Array<string>,tags?: Array<Tag>,status?: string}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Pet",
                     "promise": Promise {},
@@ -454,6 +558,7 @@ Map {
                 "externalImports": Map {},
                 "imports": Map {
                   "Category" => Object {
+                    "isDefault": false,
                     "isType": true,
                     "name": "Category",
                     "script": Script {
@@ -465,6 +570,7 @@ Map {
                           "code": "{id?: number,name?: string}",
                           "done": true,
                           "id": "SchemaTypeCoder@undefined",
+                          "isDefault": false,
                           "isType": true,
                           "name": "Category",
                           "promise": Promise {},
@@ -482,6 +588,7 @@ Map {
                     },
                   },
                   "Tag" => Object {
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tag",
                     "script": Script {
@@ -493,6 +600,7 @@ Map {
                           "code": "{id?: number,name?: string}",
                           "done": true,
                           "id": "SchemaTypeCoder@undefined",
+                          "isDefault": false,
                           "isType": true,
                           "name": "Tag",
                           "promise": Promise {},
@@ -519,6 +627,7 @@ Map {
               },
             },
             "Tools" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "script": Script {
@@ -535,6 +644,7 @@ Map {
     }",
                     "done": true,
                     "id": "tools",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tools",
                     "promise": Promise {},
@@ -556,6 +666,36 @@ Map {
                 "typeCache": Map {},
               },
             },
+            "Context2" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": "{}",
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1pet/post",
+                    "isDefault": true,
+                    "isType": true,
+                    "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 {
@@ -577,8 +717,10 @@ 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",
-      "SchemaTypeCoder@undefined@components/Pet.ts:true" => "Pet",
-      "tools@internal/tools.ts:true" => "Tools",
+      "ContextCoder@petstore.yaml#/paths/~1pet/post@paths//$context.ts:true:true" => "Context",
+      "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
+      "tools@internal/tools.ts:true:false" => "Tools",
+      "ContextCoder@petstore.yaml#/paths/~1pet/put@paths//$context.ts:true:true" => "Context2",
     },
     "exports": Map {
       "HTTP_POST" => Object {
@@ -618,13 +760,14 @@ Map {
     | void",
         "done": true,
         "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet/post",
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_POST",
         "promise": Promise {},
         "typeDeclaration": "",
       },
       "HTTP_PUT" => Object {
-        "code": "({ query, path, header, body, context, tools }: { query: undefined, path: undefined, header: undefined, body: Pet, context: Context, response: ResponseBuilderBuilder<{
+        "code": "({ query, path, header, body, context, tools }: { query: undefined, path: undefined, header: undefined, body: Pet, context: Context2, response: ResponseBuilderBuilder<{
       200: {
           headers: {};
           content: {
@@ -680,6 +823,7 @@ Map {
     | void",
         "done": true,
         "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet/put",
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_PUT",
         "promise": Promise {},
@@ -687,10 +831,6 @@ Map {
       },
     },
     "externalImports": Map {
-      "Context" => Object {
-        "isType": true,
-        "modulePath": "../context/context.js",
-      },
       "ResponseBuilderBuilder" => Object {
         "isType": true,
         "modulePath": "counterfact",
@@ -701,20 +841,52 @@ Map {
       },
     },
     "imports": Map {
+      "Context" => Object {
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "script": Script {
+          "cache": Map {
+            "default" => "Context",
+          },
+          "exports": Map {
+            "Context" => Object {
+              "code": "{}",
+              "done": true,
+              "id": "ContextCoder@petstore.yaml#/paths/~1pet/post",
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "promise": Promise {},
+              "typeDeclaration": "",
+            },
+          },
+          "externalImports": Map {},
+          "imports": Map {},
+          "path": "paths//$context.ts",
+          "repository": Repository {
+            "scripts": [Circular],
+            "writeFiles": [Function],
+          },
+          "typeCache": Map {},
+        },
+      },
       "Pet" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Pet",
         "script": Script {
           "cache": Map {
             "SchemaTypeCoder@undefined@[object Object]:true" => "Pet",
-            "SchemaTypeCoder@undefined@components/Category.ts:true" => "Category",
-            "SchemaTypeCoder@undefined@components/Tag.ts:true" => "Tag",
+            "SchemaTypeCoder@undefined@components/Category.ts:true:false" => "Category",
+            "SchemaTypeCoder@undefined@components/Tag.ts:true:false" => "Tag",
           },
           "exports": Map {
             "Pet" => Object {
               "code": "{id?: number,name: string,category?: Category,photoUrls: Array<string>,tags?: Array<Tag>,status?: string}",
               "done": true,
               "id": "SchemaTypeCoder@undefined",
+              "isDefault": false,
               "isType": true,
               "name": "Pet",
               "promise": Promise {},
@@ -724,6 +896,7 @@ Map {
           "externalImports": Map {},
           "imports": Map {
             "Category" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Category",
               "script": Script {
@@ -735,6 +908,7 @@ Map {
                     "code": "{id?: number,name?: string}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Category",
                     "promise": Promise {},
@@ -752,6 +926,7 @@ Map {
               },
             },
             "Tag" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tag",
               "script": Script {
@@ -763,6 +938,7 @@ Map {
                     "code": "{id?: number,name?: string}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tag",
                     "promise": Promise {},
@@ -789,6 +965,7 @@ Map {
         },
       },
       "Tools" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Tools",
         "script": Script {
@@ -805,6 +982,7 @@ Map {
     }",
               "done": true,
               "id": "tools",
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "promise": Promise {},
@@ -826,6 +1004,36 @@ Map {
           "typeCache": Map {},
         },
       },
+      "Context2" => Object {
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "script": Script {
+          "cache": Map {
+            "default" => "Context",
+          },
+          "exports": Map {
+            "Context" => Object {
+              "code": "{}",
+              "done": true,
+              "id": "ContextCoder@petstore.yaml#/paths/~1pet/post",
+              "isDefault": true,
+              "isType": true,
+              "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 {
@@ -837,7 +1045,7 @@ Map {
   "paths/pet/findByStatus.ts" => Script {
     "cache": Map {
       "OperationCoder@petstore.yaml#/paths/~1pet~1findByStatus/get@[object Object]:false" => "GET",
-      "OperationTypeCoder@petstore.yaml#/paths/~1pet~1findByStatus/get@path-types/pet/findByStatus.types.ts:true" => "HTTP_GET",
+      "OperationTypeCoder@petstore.yaml#/paths/~1pet~1findByStatus/get@path-types/pet/findByStatus.types.ts:true:false" => "HTTP_GET",
     },
     "exports": Map {
       "GET" => Object {
@@ -846,6 +1054,7 @@ Map {
     }",
         "done": true,
         "id": "OperationCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
+        "isDefault": false,
         "isType": false,
         "name": "GET",
         "promise": Promise {},
@@ -855,13 +1064,15 @@ Map {
     "externalImports": Map {},
     "imports": Map {
       "HTTP_GET" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_GET",
         "script": Script {
           "cache": Map {
             "OperationTypeCoder@petstore.yaml#/paths/~1pet~1findByStatus/get@[object Object]:true" => "HTTP_GET",
-            "SchemaTypeCoder@undefined@components/Pet.ts:true" => "Pet",
-            "tools@internal/tools.ts:true" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get@paths/pet/$context.ts:true:true" => "Context",
+            "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
+            "tools@internal/tools.ts:true:false" => "Tools",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -901,6 +1112,7 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_GET",
               "promise": Promise {},
@@ -908,10 +1120,6 @@ Map {
             },
           },
           "externalImports": Map {
-            "Context" => Object {
-              "isType": true,
-              "modulePath": "../../context/context.js",
-            },
             "ResponseBuilderBuilder" => Object {
               "isType": true,
               "modulePath": "counterfact",
@@ -922,20 +1130,54 @@ Map {
             },
           },
           "imports": Map {
+            "Context" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
+                    "isDefault": true,
+                    "isType": true,
+                    "name": "Context",
+                    "promise": Promise {},
+                    "typeDeclaration": "",
+                  },
+                },
+                "externalImports": Map {},
+                "imports": Map {},
+                "path": "paths/pet/$context.ts",
+                "repository": Repository {
+                  "scripts": [Circular],
+                  "writeFiles": [Function],
+                },
+                "typeCache": Map {},
+              },
+            },
             "Pet" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Pet",
               "script": Script {
                 "cache": Map {
                   "SchemaTypeCoder@undefined@[object Object]:true" => "Pet",
-                  "SchemaTypeCoder@undefined@components/Category.ts:true" => "Category",
-                  "SchemaTypeCoder@undefined@components/Tag.ts:true" => "Tag",
+                  "SchemaTypeCoder@undefined@components/Category.ts:true:false" => "Category",
+                  "SchemaTypeCoder@undefined@components/Tag.ts:true:false" => "Tag",
                 },
                 "exports": Map {
                   "Pet" => Object {
                     "code": "{id?: number,name: string,category?: Category,photoUrls: Array<string>,tags?: Array<Tag>,status?: string}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Pet",
                     "promise": Promise {},
@@ -945,6 +1187,7 @@ Map {
                 "externalImports": Map {},
                 "imports": Map {
                   "Category" => Object {
+                    "isDefault": false,
                     "isType": true,
                     "name": "Category",
                     "script": Script {
@@ -956,6 +1199,7 @@ Map {
                           "code": "{id?: number,name?: string}",
                           "done": true,
                           "id": "SchemaTypeCoder@undefined",
+                          "isDefault": false,
                           "isType": true,
                           "name": "Category",
                           "promise": Promise {},
@@ -973,6 +1217,7 @@ Map {
                     },
                   },
                   "Tag" => Object {
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tag",
                     "script": Script {
@@ -984,6 +1229,7 @@ Map {
                           "code": "{id?: number,name?: string}",
                           "done": true,
                           "id": "SchemaTypeCoder@undefined",
+                          "isDefault": false,
                           "isType": true,
                           "name": "Tag",
                           "promise": Promise {},
@@ -1010,6 +1256,7 @@ Map {
               },
             },
             "Tools" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "script": Script {
@@ -1026,6 +1273,7 @@ Map {
     }",
                     "done": true,
                     "id": "tools",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tools",
                     "promise": Promise {},
@@ -1067,8 +1315,9 @@ Map {
   "path-types/pet/findByStatus.types.ts" => Script {
     "cache": Map {
       "OperationTypeCoder@petstore.yaml#/paths/~1pet~1findByStatus/get@[object Object]:true" => "HTTP_GET",
-      "SchemaTypeCoder@undefined@components/Pet.ts:true" => "Pet",
-      "tools@internal/tools.ts:true" => "Tools",
+      "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get@paths/pet/$context.ts:true:true" => "Context",
+      "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
+      "tools@internal/tools.ts:true:false" => "Tools",
     },
     "exports": Map {
       "HTTP_GET" => Object {
@@ -1108,6 +1357,7 @@ Map {
     | void",
         "done": true,
         "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_GET",
         "promise": Promise {},
@@ -1115,10 +1365,6 @@ Map {
       },
     },
     "externalImports": Map {
-      "Context" => Object {
-        "isType": true,
-        "modulePath": "../../context/context.js",
-      },
       "ResponseBuilderBuilder" => Object {
         "isType": true,
         "modulePath": "counterfact",
@@ -1129,20 +1375,54 @@ Map {
       },
     },
     "imports": Map {
+      "Context" => Object {
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "script": Script {
+          "cache": Map {
+            "default" => "Context",
+          },
+          "exports": Map {
+            "Context" => Object {
+              "code": Object {
+                "raw": "export { default } from \\"../$context.js\\"",
+              },
+              "done": true,
+              "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "promise": Promise {},
+              "typeDeclaration": "",
+            },
+          },
+          "externalImports": Map {},
+          "imports": Map {},
+          "path": "paths/pet/$context.ts",
+          "repository": Repository {
+            "scripts": [Circular],
+            "writeFiles": [Function],
+          },
+          "typeCache": Map {},
+        },
+      },
       "Pet" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Pet",
         "script": Script {
           "cache": Map {
             "SchemaTypeCoder@undefined@[object Object]:true" => "Pet",
-            "SchemaTypeCoder@undefined@components/Category.ts:true" => "Category",
-            "SchemaTypeCoder@undefined@components/Tag.ts:true" => "Tag",
+            "SchemaTypeCoder@undefined@components/Category.ts:true:false" => "Category",
+            "SchemaTypeCoder@undefined@components/Tag.ts:true:false" => "Tag",
           },
           "exports": Map {
             "Pet" => Object {
               "code": "{id?: number,name: string,category?: Category,photoUrls: Array<string>,tags?: Array<Tag>,status?: string}",
               "done": true,
               "id": "SchemaTypeCoder@undefined",
+              "isDefault": false,
               "isType": true,
               "name": "Pet",
               "promise": Promise {},
@@ -1152,6 +1432,7 @@ Map {
           "externalImports": Map {},
           "imports": Map {
             "Category" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Category",
               "script": Script {
@@ -1163,6 +1444,7 @@ Map {
                     "code": "{id?: number,name?: string}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Category",
                     "promise": Promise {},
@@ -1180,6 +1462,7 @@ Map {
               },
             },
             "Tag" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tag",
               "script": Script {
@@ -1191,6 +1474,7 @@ Map {
                     "code": "{id?: number,name?: string}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tag",
                     "promise": Promise {},
@@ -1217,6 +1501,7 @@ Map {
         },
       },
       "Tools" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Tools",
         "script": Script {
@@ -1233,6 +1518,7 @@ Map {
     }",
               "done": true,
               "id": "tools",
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "promise": Promise {},
@@ -1265,7 +1551,7 @@ Map {
   "paths/pet/findByTags.ts" => Script {
     "cache": Map {
       "OperationCoder@petstore.yaml#/paths/~1pet~1findByTags/get@[object Object]:false" => "GET",
-      "OperationTypeCoder@petstore.yaml#/paths/~1pet~1findByTags/get@path-types/pet/findByTags.types.ts:true" => "HTTP_GET",
+      "OperationTypeCoder@petstore.yaml#/paths/~1pet~1findByTags/get@path-types/pet/findByTags.types.ts:true:false" => "HTTP_GET",
     },
     "exports": Map {
       "GET" => Object {
@@ -1274,6 +1560,7 @@ Map {
     }",
         "done": true,
         "id": "OperationCoder@petstore.yaml#/paths/~1pet~1findByTags/get",
+        "isDefault": false,
         "isType": false,
         "name": "GET",
         "promise": Promise {},
@@ -1283,13 +1570,15 @@ Map {
     "externalImports": Map {},
     "imports": Map {
       "HTTP_GET" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_GET",
         "script": Script {
           "cache": Map {
             "OperationTypeCoder@petstore.yaml#/paths/~1pet~1findByTags/get@[object Object]:true" => "HTTP_GET",
-            "SchemaTypeCoder@undefined@components/Pet.ts:true" => "Pet",
-            "tools@internal/tools.ts:true" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1pet~1findByTags/get@paths/pet/$context.ts:true:true" => "Context",
+            "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
+            "tools@internal/tools.ts:true:false" => "Tools",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -1329,6 +1618,7 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet~1findByTags/get",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_GET",
               "promise": Promise {},
@@ -1336,10 +1626,6 @@ Map {
             },
           },
           "externalImports": Map {
-            "Context" => Object {
-              "isType": true,
-              "modulePath": "../../context/context.js",
-            },
             "ResponseBuilderBuilder" => Object {
               "isType": true,
               "modulePath": "counterfact",
@@ -1350,20 +1636,54 @@ Map {
             },
           },
           "imports": Map {
+            "Context" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
+                    "isDefault": true,
+                    "isType": true,
+                    "name": "Context",
+                    "promise": Promise {},
+                    "typeDeclaration": "",
+                  },
+                },
+                "externalImports": Map {},
+                "imports": Map {},
+                "path": "paths/pet/$context.ts",
+                "repository": Repository {
+                  "scripts": [Circular],
+                  "writeFiles": [Function],
+                },
+                "typeCache": Map {},
+              },
+            },
             "Pet" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Pet",
               "script": Script {
                 "cache": Map {
                   "SchemaTypeCoder@undefined@[object Object]:true" => "Pet",
-                  "SchemaTypeCoder@undefined@components/Category.ts:true" => "Category",
-                  "SchemaTypeCoder@undefined@components/Tag.ts:true" => "Tag",
+                  "SchemaTypeCoder@undefined@components/Category.ts:true:false" => "Category",
+                  "SchemaTypeCoder@undefined@components/Tag.ts:true:false" => "Tag",
                 },
                 "exports": Map {
                   "Pet" => Object {
                     "code": "{id?: number,name: string,category?: Category,photoUrls: Array<string>,tags?: Array<Tag>,status?: string}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Pet",
                     "promise": Promise {},
@@ -1373,6 +1693,7 @@ Map {
                 "externalImports": Map {},
                 "imports": Map {
                   "Category" => Object {
+                    "isDefault": false,
                     "isType": true,
                     "name": "Category",
                     "script": Script {
@@ -1384,6 +1705,7 @@ Map {
                           "code": "{id?: number,name?: string}",
                           "done": true,
                           "id": "SchemaTypeCoder@undefined",
+                          "isDefault": false,
                           "isType": true,
                           "name": "Category",
                           "promise": Promise {},
@@ -1401,6 +1723,7 @@ Map {
                     },
                   },
                   "Tag" => Object {
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tag",
                     "script": Script {
@@ -1412,6 +1735,7 @@ Map {
                           "code": "{id?: number,name?: string}",
                           "done": true,
                           "id": "SchemaTypeCoder@undefined",
+                          "isDefault": false,
                           "isType": true,
                           "name": "Tag",
                           "promise": Promise {},
@@ -1438,6 +1762,7 @@ Map {
               },
             },
             "Tools" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "script": Script {
@@ -1454,6 +1779,7 @@ Map {
     }",
                     "done": true,
                     "id": "tools",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tools",
                     "promise": Promise {},
@@ -1495,8 +1821,9 @@ Map {
   "path-types/pet/findByTags.types.ts" => Script {
     "cache": Map {
       "OperationTypeCoder@petstore.yaml#/paths/~1pet~1findByTags/get@[object Object]:true" => "HTTP_GET",
-      "SchemaTypeCoder@undefined@components/Pet.ts:true" => "Pet",
-      "tools@internal/tools.ts:true" => "Tools",
+      "ContextCoder@petstore.yaml#/paths/~1pet~1findByTags/get@paths/pet/$context.ts:true:true" => "Context",
+      "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
+      "tools@internal/tools.ts:true:false" => "Tools",
     },
     "exports": Map {
       "HTTP_GET" => Object {
@@ -1536,6 +1863,7 @@ Map {
     | void",
         "done": true,
         "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet~1findByTags/get",
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_GET",
         "promise": Promise {},
@@ -1543,10 +1871,6 @@ Map {
       },
     },
     "externalImports": Map {
-      "Context" => Object {
-        "isType": true,
-        "modulePath": "../../context/context.js",
-      },
       "ResponseBuilderBuilder" => Object {
         "isType": true,
         "modulePath": "counterfact",
@@ -1557,20 +1881,54 @@ Map {
       },
     },
     "imports": Map {
+      "Context" => Object {
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "script": Script {
+          "cache": Map {
+            "default" => "Context",
+          },
+          "exports": Map {
+            "Context" => Object {
+              "code": Object {
+                "raw": "export { default } from \\"../$context.js\\"",
+              },
+              "done": true,
+              "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "promise": Promise {},
+              "typeDeclaration": "",
+            },
+          },
+          "externalImports": Map {},
+          "imports": Map {},
+          "path": "paths/pet/$context.ts",
+          "repository": Repository {
+            "scripts": [Circular],
+            "writeFiles": [Function],
+          },
+          "typeCache": Map {},
+        },
+      },
       "Pet" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Pet",
         "script": Script {
           "cache": Map {
             "SchemaTypeCoder@undefined@[object Object]:true" => "Pet",
-            "SchemaTypeCoder@undefined@components/Category.ts:true" => "Category",
-            "SchemaTypeCoder@undefined@components/Tag.ts:true" => "Tag",
+            "SchemaTypeCoder@undefined@components/Category.ts:true:false" => "Category",
+            "SchemaTypeCoder@undefined@components/Tag.ts:true:false" => "Tag",
           },
           "exports": Map {
             "Pet" => Object {
               "code": "{id?: number,name: string,category?: Category,photoUrls: Array<string>,tags?: Array<Tag>,status?: string}",
               "done": true,
               "id": "SchemaTypeCoder@undefined",
+              "isDefault": false,
               "isType": true,
               "name": "Pet",
               "promise": Promise {},
@@ -1580,6 +1938,7 @@ Map {
           "externalImports": Map {},
           "imports": Map {
             "Category" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Category",
               "script": Script {
@@ -1591,6 +1950,7 @@ Map {
                     "code": "{id?: number,name?: string}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Category",
                     "promise": Promise {},
@@ -1608,6 +1968,7 @@ Map {
               },
             },
             "Tag" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tag",
               "script": Script {
@@ -1619,6 +1980,7 @@ Map {
                     "code": "{id?: number,name?: string}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tag",
                     "promise": Promise {},
@@ -1645,6 +2007,7 @@ Map {
         },
       },
       "Tools" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Tools",
         "script": Script {
@@ -1661,6 +2024,7 @@ Map {
     }",
               "done": true,
               "id": "tools",
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "promise": Promise {},
@@ -1693,11 +2057,11 @@ Map {
   "paths/pet/{petId}.ts" => Script {
     "cache": Map {
       "OperationCoder@petstore.yaml#/paths/~1pet~1{petId}/get@[object Object]:false" => "GET",
-      "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}/get@path-types/pet/{petId}.types.ts:true" => "HTTP_GET",
+      "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}/get@path-types/pet/{petId}.types.ts:true:false" => "HTTP_GET",
       "OperationCoder@petstore.yaml#/paths/~1pet~1{petId}/post@[object Object]:false" => "POST",
-      "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}/post@path-types/pet/{petId}.types.ts:true" => "HTTP_POST",
+      "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}/post@path-types/pet/{petId}.types.ts:true:false" => "HTTP_POST",
       "OperationCoder@petstore.yaml#/paths/~1pet~1{petId}/delete@[object Object]:false" => "DELETE",
-      "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}/delete@path-types/pet/{petId}.types.ts:true" => "HTTP_DELETE",
+      "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}/delete@path-types/pet/{petId}.types.ts:true:false" => "HTTP_DELETE",
     },
     "exports": Map {
       "GET" => Object {
@@ -1706,6 +2070,7 @@ Map {
     }",
         "done": true,
         "id": "OperationCoder@petstore.yaml#/paths/~1pet~1{petId}/get",
+        "isDefault": false,
         "isType": false,
         "name": "GET",
         "promise": Promise {},
@@ -1715,6 +2080,7 @@ Map {
         "code": "() => { /* no response content specified in the OpenAPI document */ }",
         "done": true,
         "id": "OperationCoder@petstore.yaml#/paths/~1pet~1{petId}/post",
+        "isDefault": false,
         "isType": false,
         "name": "POST",
         "promise": Promise {},
@@ -1724,6 +2090,7 @@ Map {
         "code": "() => { /* no response content specified in the OpenAPI document */ }",
         "done": true,
         "id": "OperationCoder@petstore.yaml#/paths/~1pet~1{petId}/delete",
+        "isDefault": false,
         "isType": false,
         "name": "DELETE",
         "promise": Promise {},
@@ -1733,6 +2100,7 @@ Map {
     "externalImports": Map {},
     "imports": Map {
       "HTTP_GET" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_GET",
         "script": Script {
@@ -1740,8 +2108,11 @@ Map {
             "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",
-            "SchemaTypeCoder@undefined@components/Pet.ts:true" => "Pet",
-            "tools@internal/tools.ts:true" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1pet~1{petId}/get@paths/pet/$context.ts:true:true" => "Context",
+            "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
+            "tools@internal/tools.ts:true:false" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1pet~1{petId}/post@paths/pet/$context.ts:true:true" => "Context2",
+            "ContextCoder@petstore.yaml#/paths/~1pet~1{petId}/delete@paths/pet/$context.ts:true:true" => "Context3",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -1791,13 +2162,14 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}/get",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_GET",
               "promise": Promise {},
               "typeDeclaration": "",
             },
             "HTTP_POST" => Object {
-              "code": "({ query, path, header, body, context, tools }: { query: {name?: number, status?: string}, path: {petId: number}, header: never, body: undefined, context: Context, response: ResponseBuilderBuilder<{
+              "code": "({ query, path, header, body, context, tools }: { query: {name?: number, status?: string}, path: {petId: number}, header: never, body: undefined, context: Context2, response: ResponseBuilderBuilder<{
       405: {
           headers: {};
           content: {
@@ -1813,13 +2185,14 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}/post",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_POST",
               "promise": Promise {},
               "typeDeclaration": "",
             },
             "HTTP_DELETE" => Object {
-              "code": "({ query, path, header, body, context, tools }: { query: never, path: {petId: string}, header: {api_key?: string}, body: undefined, context: Context, response: ResponseBuilderBuilder<{
+              "code": "({ query, path, header, body, context, tools }: { query: never, path: {petId: string}, header: {api_key?: string}, body: undefined, context: Context3, response: ResponseBuilderBuilder<{
       400: {
           headers: {};
           content: {
@@ -1835,6 +2208,7 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}/delete",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_DELETE",
               "promise": Promise {},
@@ -1842,10 +2216,6 @@ Map {
             },
           },
           "externalImports": Map {
-            "Context" => Object {
-              "isType": true,
-              "modulePath": "../../context/context.js",
-            },
             "ResponseBuilderBuilder" => Object {
               "isType": true,
               "modulePath": "counterfact",
@@ -1856,32 +2226,67 @@ Map {
             },
           },
           "imports": Map {
-            "Pet" => Object {
+            "Context" => Object {
+              "isDefault": true,
               "isType": true,
-              "name": "Pet",
+              "name": "Context",
               "script": Script {
                 "cache": Map {
-                  "SchemaTypeCoder@undefined@[object Object]:true" => "Pet",
-                  "SchemaTypeCoder@undefined@components/Category.ts:true" => "Category",
-                  "SchemaTypeCoder@undefined@components/Tag.ts:true" => "Tag",
+                  "default" => "Context",
                 },
                 "exports": Map {
-                  "Pet" => Object {
-                    "code": "{id?: number,name: string,category?: Category,photoUrls: Array<string>,tags?: Array<Tag>,status?: string}",
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
                     "done": true,
-                    "id": "SchemaTypeCoder@undefined",
+                    "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
+                    "isDefault": true,
                     "isType": true,
-                    "name": "Pet",
+                    "name": "Context",
                     "promise": Promise {},
                     "typeDeclaration": "",
                   },
                 },
                 "externalImports": Map {},
-                "imports": Map {
-                  "Category" => Object {
-                    "isType": true,
-                    "name": "Category",
-                    "script": Script {
+                "imports": Map {},
+                "path": "paths/pet/$context.ts",
+                "repository": Repository {
+                  "scripts": [Circular],
+                  "writeFiles": [Function],
+                },
+                "typeCache": Map {},
+              },
+            },
+            "Pet" => Object {
+              "isDefault": false,
+              "isType": true,
+              "name": "Pet",
+              "script": Script {
+                "cache": Map {
+                  "SchemaTypeCoder@undefined@[object Object]:true" => "Pet",
+                  "SchemaTypeCoder@undefined@components/Category.ts:true:false" => "Category",
+                  "SchemaTypeCoder@undefined@components/Tag.ts:true:false" => "Tag",
+                },
+                "exports": Map {
+                  "Pet" => Object {
+                    "code": "{id?: number,name: string,category?: Category,photoUrls: Array<string>,tags?: Array<Tag>,status?: string}",
+                    "done": true,
+                    "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
+                    "isType": true,
+                    "name": "Pet",
+                    "promise": Promise {},
+                    "typeDeclaration": "",
+                  },
+                },
+                "externalImports": Map {},
+                "imports": Map {
+                  "Category" => Object {
+                    "isDefault": false,
+                    "isType": true,
+                    "name": "Category",
+                    "script": Script {
                       "cache": Map {
                         "SchemaTypeCoder@undefined@[object Object]:true" => "Category",
                       },
@@ -1890,6 +2295,7 @@ Map {
                           "code": "{id?: number,name?: string}",
                           "done": true,
                           "id": "SchemaTypeCoder@undefined",
+                          "isDefault": false,
                           "isType": true,
                           "name": "Category",
                           "promise": Promise {},
@@ -1907,6 +2313,7 @@ Map {
                     },
                   },
                   "Tag" => Object {
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tag",
                     "script": Script {
@@ -1918,6 +2325,7 @@ Map {
                           "code": "{id?: number,name?: string}",
                           "done": true,
                           "id": "SchemaTypeCoder@undefined",
+                          "isDefault": false,
                           "isType": true,
                           "name": "Tag",
                           "promise": Promise {},
@@ -1944,6 +2352,7 @@ Map {
               },
             },
             "Tools" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "script": Script {
@@ -1960,6 +2369,7 @@ Map {
     }",
                     "done": true,
                     "id": "tools",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tools",
                     "promise": Promise {},
@@ -1981,6 +2391,70 @@ Map {
                 "typeCache": Map {},
               },
             },
+            "Context2" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
+                    "isDefault": true,
+                    "isType": true,
+                    "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": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
+                    "isDefault": true,
+                    "isType": true,
+                    "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 {
@@ -1991,6 +2465,7 @@ Map {
         },
       },
       "HTTP_POST" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_POST",
         "script": Script {
@@ -1998,8 +2473,11 @@ Map {
             "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",
-            "SchemaTypeCoder@undefined@components/Pet.ts:true" => "Pet",
-            "tools@internal/tools.ts:true" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1pet~1{petId}/get@paths/pet/$context.ts:true:true" => "Context",
+            "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
+            "tools@internal/tools.ts:true:false" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1pet~1{petId}/post@paths/pet/$context.ts:true:true" => "Context2",
+            "ContextCoder@petstore.yaml#/paths/~1pet~1{petId}/delete@paths/pet/$context.ts:true:true" => "Context3",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -2049,13 +2527,14 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}/get",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_GET",
               "promise": Promise {},
               "typeDeclaration": "",
             },
             "HTTP_POST" => Object {
-              "code": "({ query, path, header, body, context, tools }: { query: {name?: number, status?: string}, path: {petId: number}, header: never, body: undefined, context: Context, response: ResponseBuilderBuilder<{
+              "code": "({ query, path, header, body, context, tools }: { query: {name?: number, status?: string}, path: {petId: number}, header: never, body: undefined, context: Context2, response: ResponseBuilderBuilder<{
       405: {
           headers: {};
           content: {
@@ -2071,13 +2550,14 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}/post",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_POST",
               "promise": Promise {},
               "typeDeclaration": "",
             },
             "HTTP_DELETE" => Object {
-              "code": "({ query, path, header, body, context, tools }: { query: never, path: {petId: string}, header: {api_key?: string}, body: undefined, context: Context, response: ResponseBuilderBuilder<{
+              "code": "({ query, path, header, body, context, tools }: { query: never, path: {petId: string}, header: {api_key?: string}, body: undefined, context: Context3, response: ResponseBuilderBuilder<{
       400: {
           headers: {};
           content: {
@@ -2093,6 +2573,7 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}/delete",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_DELETE",
               "promise": Promise {},
@@ -2100,10 +2581,6 @@ Map {
             },
           },
           "externalImports": Map {
-            "Context" => Object {
-              "isType": true,
-              "modulePath": "../../context/context.js",
-            },
             "ResponseBuilderBuilder" => Object {
               "isType": true,
               "modulePath": "counterfact",
@@ -2114,20 +2591,54 @@ Map {
             },
           },
           "imports": Map {
+            "Context" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
+                    "isDefault": true,
+                    "isType": true,
+                    "name": "Context",
+                    "promise": Promise {},
+                    "typeDeclaration": "",
+                  },
+                },
+                "externalImports": Map {},
+                "imports": Map {},
+                "path": "paths/pet/$context.ts",
+                "repository": Repository {
+                  "scripts": [Circular],
+                  "writeFiles": [Function],
+                },
+                "typeCache": Map {},
+              },
+            },
             "Pet" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Pet",
               "script": Script {
                 "cache": Map {
                   "SchemaTypeCoder@undefined@[object Object]:true" => "Pet",
-                  "SchemaTypeCoder@undefined@components/Category.ts:true" => "Category",
-                  "SchemaTypeCoder@undefined@components/Tag.ts:true" => "Tag",
+                  "SchemaTypeCoder@undefined@components/Category.ts:true:false" => "Category",
+                  "SchemaTypeCoder@undefined@components/Tag.ts:true:false" => "Tag",
                 },
                 "exports": Map {
                   "Pet" => Object {
                     "code": "{id?: number,name: string,category?: Category,photoUrls: Array<string>,tags?: Array<Tag>,status?: string}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Pet",
                     "promise": Promise {},
@@ -2137,6 +2648,7 @@ Map {
                 "externalImports": Map {},
                 "imports": Map {
                   "Category" => Object {
+                    "isDefault": false,
                     "isType": true,
                     "name": "Category",
                     "script": Script {
@@ -2148,6 +2660,7 @@ Map {
                           "code": "{id?: number,name?: string}",
                           "done": true,
                           "id": "SchemaTypeCoder@undefined",
+                          "isDefault": false,
                           "isType": true,
                           "name": "Category",
                           "promise": Promise {},
@@ -2165,6 +2678,7 @@ Map {
                     },
                   },
                   "Tag" => Object {
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tag",
                     "script": Script {
@@ -2176,6 +2690,7 @@ Map {
                           "code": "{id?: number,name?: string}",
                           "done": true,
                           "id": "SchemaTypeCoder@undefined",
+                          "isDefault": false,
                           "isType": true,
                           "name": "Tag",
                           "promise": Promise {},
@@ -2202,6 +2717,7 @@ Map {
               },
             },
             "Tools" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "script": Script {
@@ -2218,6 +2734,7 @@ Map {
     }",
                     "done": true,
                     "id": "tools",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tools",
                     "promise": Promise {},
@@ -2239,6 +2756,70 @@ Map {
                 "typeCache": Map {},
               },
             },
+            "Context2" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
+                    "isDefault": true,
+                    "isType": true,
+                    "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": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
+                    "isDefault": true,
+                    "isType": true,
+                    "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 {
@@ -2249,6 +2830,7 @@ Map {
         },
       },
       "HTTP_DELETE" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_DELETE",
         "script": Script {
@@ -2256,8 +2838,11 @@ Map {
             "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",
-            "SchemaTypeCoder@undefined@components/Pet.ts:true" => "Pet",
-            "tools@internal/tools.ts:true" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1pet~1{petId}/get@paths/pet/$context.ts:true:true" => "Context",
+            "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
+            "tools@internal/tools.ts:true:false" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1pet~1{petId}/post@paths/pet/$context.ts:true:true" => "Context2",
+            "ContextCoder@petstore.yaml#/paths/~1pet~1{petId}/delete@paths/pet/$context.ts:true:true" => "Context3",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -2307,13 +2892,14 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}/get",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_GET",
               "promise": Promise {},
               "typeDeclaration": "",
             },
             "HTTP_POST" => Object {
-              "code": "({ query, path, header, body, context, tools }: { query: {name?: number, status?: string}, path: {petId: number}, header: never, body: undefined, context: Context, response: ResponseBuilderBuilder<{
+              "code": "({ query, path, header, body, context, tools }: { query: {name?: number, status?: string}, path: {petId: number}, header: never, body: undefined, context: Context2, response: ResponseBuilderBuilder<{
       405: {
           headers: {};
           content: {
@@ -2329,13 +2915,14 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}/post",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_POST",
               "promise": Promise {},
               "typeDeclaration": "",
             },
             "HTTP_DELETE" => Object {
-              "code": "({ query, path, header, body, context, tools }: { query: never, path: {petId: string}, header: {api_key?: string}, body: undefined, context: Context, response: ResponseBuilderBuilder<{
+              "code": "({ query, path, header, body, context, tools }: { query: never, path: {petId: string}, header: {api_key?: string}, body: undefined, context: Context3, response: ResponseBuilderBuilder<{
       400: {
           headers: {};
           content: {
@@ -2351,6 +2938,7 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}/delete",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_DELETE",
               "promise": Promise {},
@@ -2358,10 +2946,6 @@ Map {
             },
           },
           "externalImports": Map {
-            "Context" => Object {
-              "isType": true,
-              "modulePath": "../../context/context.js",
-            },
             "ResponseBuilderBuilder" => Object {
               "isType": true,
               "modulePath": "counterfact",
@@ -2372,20 +2956,54 @@ Map {
             },
           },
           "imports": Map {
+            "Context" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
+                    "isDefault": true,
+                    "isType": true,
+                    "name": "Context",
+                    "promise": Promise {},
+                    "typeDeclaration": "",
+                  },
+                },
+                "externalImports": Map {},
+                "imports": Map {},
+                "path": "paths/pet/$context.ts",
+                "repository": Repository {
+                  "scripts": [Circular],
+                  "writeFiles": [Function],
+                },
+                "typeCache": Map {},
+              },
+            },
             "Pet" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Pet",
               "script": Script {
                 "cache": Map {
                   "SchemaTypeCoder@undefined@[object Object]:true" => "Pet",
-                  "SchemaTypeCoder@undefined@components/Category.ts:true" => "Category",
-                  "SchemaTypeCoder@undefined@components/Tag.ts:true" => "Tag",
+                  "SchemaTypeCoder@undefined@components/Category.ts:true:false" => "Category",
+                  "SchemaTypeCoder@undefined@components/Tag.ts:true:false" => "Tag",
                 },
                 "exports": Map {
                   "Pet" => Object {
                     "code": "{id?: number,name: string,category?: Category,photoUrls: Array<string>,tags?: Array<Tag>,status?: string}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Pet",
                     "promise": Promise {},
@@ -2395,6 +3013,7 @@ Map {
                 "externalImports": Map {},
                 "imports": Map {
                   "Category" => Object {
+                    "isDefault": false,
                     "isType": true,
                     "name": "Category",
                     "script": Script {
@@ -2406,6 +3025,7 @@ Map {
                           "code": "{id?: number,name?: string}",
                           "done": true,
                           "id": "SchemaTypeCoder@undefined",
+                          "isDefault": false,
                           "isType": true,
                           "name": "Category",
                           "promise": Promise {},
@@ -2423,6 +3043,7 @@ Map {
                     },
                   },
                   "Tag" => Object {
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tag",
                     "script": Script {
@@ -2434,6 +3055,7 @@ Map {
                           "code": "{id?: number,name?: string}",
                           "done": true,
                           "id": "SchemaTypeCoder@undefined",
+                          "isDefault": false,
                           "isType": true,
                           "name": "Tag",
                           "promise": Promise {},
@@ -2460,6 +3082,7 @@ Map {
               },
             },
             "Tools" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "script": Script {
@@ -2476,6 +3099,7 @@ Map {
     }",
                     "done": true,
                     "id": "tools",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tools",
                     "promise": Promise {},
@@ -2497,6 +3121,70 @@ Map {
                 "typeCache": Map {},
               },
             },
+            "Context2" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
+                    "isDefault": true,
+                    "isType": true,
+                    "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": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
+                    "isDefault": true,
+                    "isType": true,
+                    "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 {
@@ -2519,8 +3207,11 @@ Map {
       "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",
-      "SchemaTypeCoder@undefined@components/Pet.ts:true" => "Pet",
-      "tools@internal/tools.ts:true" => "Tools",
+      "ContextCoder@petstore.yaml#/paths/~1pet~1{petId}/get@paths/pet/$context.ts:true:true" => "Context",
+      "SchemaTypeCoder@undefined@components/Pet.ts:true:false" => "Pet",
+      "tools@internal/tools.ts:true:false" => "Tools",
+      "ContextCoder@petstore.yaml#/paths/~1pet~1{petId}/post@paths/pet/$context.ts:true:true" => "Context2",
+      "ContextCoder@petstore.yaml#/paths/~1pet~1{petId}/delete@paths/pet/$context.ts:true:true" => "Context3",
     },
     "exports": Map {
       "HTTP_GET" => Object {
@@ -2570,13 +3261,14 @@ Map {
     | void",
         "done": true,
         "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}/get",
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_GET",
         "promise": Promise {},
         "typeDeclaration": "",
       },
       "HTTP_POST" => Object {
-        "code": "({ query, path, header, body, context, tools }: { query: {name?: number, status?: string}, path: {petId: number}, header: never, body: undefined, context: Context, response: ResponseBuilderBuilder<{
+        "code": "({ query, path, header, body, context, tools }: { query: {name?: number, status?: string}, path: {petId: number}, header: never, body: undefined, context: Context2, response: ResponseBuilderBuilder<{
       405: {
           headers: {};
           content: {
@@ -2592,13 +3284,14 @@ Map {
     | void",
         "done": true,
         "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}/post",
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_POST",
         "promise": Promise {},
         "typeDeclaration": "",
       },
       "HTTP_DELETE" => Object {
-        "code": "({ query, path, header, body, context, tools }: { query: never, path: {petId: string}, header: {api_key?: string}, body: undefined, context: Context, response: ResponseBuilderBuilder<{
+        "code": "({ query, path, header, body, context, tools }: { query: never, path: {petId: string}, header: {api_key?: string}, body: undefined, context: Context3, response: ResponseBuilderBuilder<{
       400: {
           headers: {};
           content: {
@@ -2614,6 +3307,7 @@ Map {
     | void",
         "done": true,
         "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}/delete",
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_DELETE",
         "promise": Promise {},
@@ -2621,10 +3315,6 @@ Map {
       },
     },
     "externalImports": Map {
-      "Context" => Object {
-        "isType": true,
-        "modulePath": "../../context/context.js",
-      },
       "ResponseBuilderBuilder" => Object {
         "isType": true,
         "modulePath": "counterfact",
@@ -2635,20 +3325,54 @@ Map {
       },
     },
     "imports": Map {
+      "Context" => Object {
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "script": Script {
+          "cache": Map {
+            "default" => "Context",
+          },
+          "exports": Map {
+            "Context" => Object {
+              "code": Object {
+                "raw": "export { default } from \\"../$context.js\\"",
+              },
+              "done": true,
+              "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "promise": Promise {},
+              "typeDeclaration": "",
+            },
+          },
+          "externalImports": Map {},
+          "imports": Map {},
+          "path": "paths/pet/$context.ts",
+          "repository": Repository {
+            "scripts": [Circular],
+            "writeFiles": [Function],
+          },
+          "typeCache": Map {},
+        },
+      },
       "Pet" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Pet",
         "script": Script {
           "cache": Map {
             "SchemaTypeCoder@undefined@[object Object]:true" => "Pet",
-            "SchemaTypeCoder@undefined@components/Category.ts:true" => "Category",
-            "SchemaTypeCoder@undefined@components/Tag.ts:true" => "Tag",
+            "SchemaTypeCoder@undefined@components/Category.ts:true:false" => "Category",
+            "SchemaTypeCoder@undefined@components/Tag.ts:true:false" => "Tag",
           },
           "exports": Map {
             "Pet" => Object {
               "code": "{id?: number,name: string,category?: Category,photoUrls: Array<string>,tags?: Array<Tag>,status?: string}",
               "done": true,
               "id": "SchemaTypeCoder@undefined",
+              "isDefault": false,
               "isType": true,
               "name": "Pet",
               "promise": Promise {},
@@ -2658,6 +3382,7 @@ Map {
           "externalImports": Map {},
           "imports": Map {
             "Category" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Category",
               "script": Script {
@@ -2669,6 +3394,7 @@ Map {
                     "code": "{id?: number,name?: string}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Category",
                     "promise": Promise {},
@@ -2686,6 +3412,7 @@ Map {
               },
             },
             "Tag" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tag",
               "script": Script {
@@ -2697,6 +3424,7 @@ Map {
                     "code": "{id?: number,name?: string}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tag",
                     "promise": Promise {},
@@ -2723,6 +3451,7 @@ Map {
         },
       },
       "Tools" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Tools",
         "script": Script {
@@ -2739,6 +3468,7 @@ Map {
     }",
               "done": true,
               "id": "tools",
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "promise": Promise {},
@@ -2760,42 +3490,109 @@ Map {
           "typeCache": Map {},
         },
       },
-    },
-    "path": "path-types/pet/{petId}.types.ts",
-    "repository": Repository {
-      "scripts": [Circular],
-      "writeFiles": [Function],
-    },
-    "typeCache": Map {},
-  },
-  "paths/pet/{petId}/uploadImage.ts" => Script {
-    "cache": Map {
-      "OperationCoder@petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post@[object Object]:false" => "POST",
-      "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post@path-types/pet/{petId}/uploadImage.types.ts:true" => "HTTP_POST",
-    },
-    "exports": Map {
-      "POST" => Object {
-        "code": "({ response}) => {
-      return response[200].random();
-    }",
-        "done": true,
-        "id": "OperationCoder@petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post",
-        "isType": false,
-        "name": "POST",
-        "promise": Promise {},
+      "Context2" => Object {
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "script": Script {
+          "cache": Map {
+            "default" => "Context",
+          },
+          "exports": Map {
+            "Context" => Object {
+              "code": Object {
+                "raw": "export { default } from \\"../$context.js\\"",
+              },
+              "done": true,
+              "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
+              "isDefault": true,
+              "isType": true,
+              "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": true,
+        "name": "Context",
+        "script": Script {
+          "cache": Map {
+            "default" => "Context",
+          },
+          "exports": Map {
+            "Context" => Object {
+              "code": Object {
+                "raw": "export { default } from \\"../$context.js\\"",
+              },
+              "done": true,
+              "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
+              "isDefault": true,
+              "isType": true,
+              "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 {
+      "scripts": [Circular],
+      "writeFiles": [Function],
+    },
+    "typeCache": Map {},
+  },
+  "paths/pet/{petId}/uploadImage.ts" => Script {
+    "cache": Map {
+      "OperationCoder@petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post@[object Object]:false" => "POST",
+      "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post@path-types/pet/{petId}/uploadImage.types.ts:true:false" => "HTTP_POST",
+    },
+    "exports": Map {
+      "POST" => Object {
+        "code": "({ response}) => {
+      return response[200].random();
+    }",
+        "done": true,
+        "id": "OperationCoder@petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post",
+        "isDefault": false,
+        "isType": false,
+        "name": "POST",
+        "promise": Promise {},
         "typeDeclaration": "HTTP_POST",
       },
     },
     "externalImports": Map {},
     "imports": Map {
       "HTTP_POST" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_POST",
         "script": Script {
           "cache": Map {
             "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post@[object Object]:true" => "HTTP_POST",
-            "SchemaTypeCoder@undefined@components/ApiResponse.ts:true" => "ApiResponse",
-            "tools@internal/tools.ts:true" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post@paths/pet/{petId}/$context.ts:true:true" => "Context",
+            "SchemaTypeCoder@undefined@components/ApiResponse.ts:true:false" => "ApiResponse",
+            "tools@internal/tools.ts:true:false" => "Tools",
           },
           "exports": Map {
             "HTTP_POST" => Object {
@@ -2817,6 +3614,7 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_POST",
               "promise": Promise {},
@@ -2824,10 +3622,6 @@ Map {
             },
           },
           "externalImports": Map {
-            "Context" => Object {
-              "isType": true,
-              "modulePath": "../../../context/context.js",
-            },
             "ResponseBuilderBuilder" => Object {
               "isType": true,
               "modulePath": "counterfact",
@@ -2838,7 +3632,40 @@ Map {
             },
           },
           "imports": Map {
+            "Context" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post",
+                    "isDefault": true,
+                    "isType": true,
+                    "name": "Context",
+                    "promise": Promise {},
+                    "typeDeclaration": "",
+                  },
+                },
+                "externalImports": Map {},
+                "imports": Map {},
+                "path": "paths/pet/{petId}/$context.ts",
+                "repository": Repository {
+                  "scripts": [Circular],
+                  "writeFiles": [Function],
+                },
+                "typeCache": Map {},
+              },
+            },
             "ApiResponse" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "ApiResponse",
               "script": Script {
@@ -2850,6 +3677,7 @@ Map {
                     "code": "{code?: number,type?: string,message?: string}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "ApiResponse",
                     "promise": Promise {},
@@ -2867,6 +3695,7 @@ Map {
               },
             },
             "Tools" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "script": Script {
@@ -2883,6 +3712,7 @@ Map {
     }",
                     "done": true,
                     "id": "tools",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tools",
                     "promise": Promise {},
@@ -2924,8 +3754,9 @@ Map {
   "path-types/pet/{petId}/uploadImage.types.ts" => Script {
     "cache": Map {
       "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post@[object Object]:true" => "HTTP_POST",
-      "SchemaTypeCoder@undefined@components/ApiResponse.ts:true" => "ApiResponse",
-      "tools@internal/tools.ts:true" => "Tools",
+      "ContextCoder@petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post@paths/pet/{petId}/$context.ts:true:true" => "Context",
+      "SchemaTypeCoder@undefined@components/ApiResponse.ts:true:false" => "ApiResponse",
+      "tools@internal/tools.ts:true:false" => "Tools",
     },
     "exports": Map {
       "HTTP_POST" => Object {
@@ -2947,6 +3778,7 @@ Map {
     | void",
         "done": true,
         "id": "OperationTypeCoder@petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post",
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_POST",
         "promise": Promise {},
@@ -2954,10 +3786,6 @@ Map {
       },
     },
     "externalImports": Map {
-      "Context" => Object {
-        "isType": true,
-        "modulePath": "../../../context/context.js",
-      },
       "ResponseBuilderBuilder" => Object {
         "isType": true,
         "modulePath": "counterfact",
@@ -2968,7 +3796,40 @@ Map {
       },
     },
     "imports": Map {
+      "Context" => Object {
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "script": Script {
+          "cache": Map {
+            "default" => "Context",
+          },
+          "exports": Map {
+            "Context" => Object {
+              "code": Object {
+                "raw": "export { default } from \\"../$context.js\\"",
+              },
+              "done": true,
+              "id": "ContextCoder@petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post",
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "promise": Promise {},
+              "typeDeclaration": "",
+            },
+          },
+          "externalImports": Map {},
+          "imports": Map {},
+          "path": "paths/pet/{petId}/$context.ts",
+          "repository": Repository {
+            "scripts": [Circular],
+            "writeFiles": [Function],
+          },
+          "typeCache": Map {},
+        },
+      },
       "ApiResponse" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "ApiResponse",
         "script": Script {
@@ -2980,6 +3841,7 @@ Map {
               "code": "{code?: number,type?: string,message?: string}",
               "done": true,
               "id": "SchemaTypeCoder@undefined",
+              "isDefault": false,
               "isType": true,
               "name": "ApiResponse",
               "promise": Promise {},
@@ -2997,6 +3859,7 @@ Map {
         },
       },
       "Tools" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Tools",
         "script": Script {
@@ -3013,6 +3876,7 @@ Map {
     }",
               "done": true,
               "id": "tools",
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "promise": Promise {},
@@ -3045,7 +3909,7 @@ Map {
   "paths/store/inventory.ts" => Script {
     "cache": Map {
       "OperationCoder@petstore.yaml#/paths/~1store~1inventory/get@[object Object]:false" => "GET",
-      "OperationTypeCoder@petstore.yaml#/paths/~1store~1inventory/get@path-types/store/inventory.types.ts:true" => "HTTP_GET",
+      "OperationTypeCoder@petstore.yaml#/paths/~1store~1inventory/get@path-types/store/inventory.types.ts:true:false" => "HTTP_GET",
     },
     "exports": Map {
       "GET" => Object {
@@ -3054,6 +3918,7 @@ Map {
     }",
         "done": true,
         "id": "OperationCoder@petstore.yaml#/paths/~1store~1inventory/get",
+        "isDefault": false,
         "isType": false,
         "name": "GET",
         "promise": Promise {},
@@ -3063,12 +3928,14 @@ Map {
     "externalImports": Map {},
     "imports": Map {
       "HTTP_GET" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_GET",
         "script": Script {
           "cache": Map {
             "OperationTypeCoder@petstore.yaml#/paths/~1store~1inventory/get@[object Object]:true" => "HTTP_GET",
-            "tools@internal/tools.ts:true" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1store~1inventory/get@paths/store/$context.ts:true:true" => "Context",
+            "tools@internal/tools.ts:true:false" => "Tools",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -3090,6 +3957,7 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1store~1inventory/get",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_GET",
               "promise": Promise {},
@@ -3097,10 +3965,6 @@ Map {
             },
           },
           "externalImports": Map {
-            "Context" => Object {
-              "isType": true,
-              "modulePath": "../../context/context.js",
-            },
             "ResponseBuilderBuilder" => Object {
               "isType": true,
               "modulePath": "counterfact",
@@ -3111,7 +3975,40 @@ Map {
             },
           },
           "imports": Map {
+            "Context" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1store~1inventory/get",
+                    "isDefault": true,
+                    "isType": true,
+                    "name": "Context",
+                    "promise": Promise {},
+                    "typeDeclaration": "",
+                  },
+                },
+                "externalImports": Map {},
+                "imports": Map {},
+                "path": "paths/store/$context.ts",
+                "repository": Repository {
+                  "scripts": [Circular],
+                  "writeFiles": [Function],
+                },
+                "typeCache": Map {},
+              },
+            },
             "Tools" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "script": Script {
@@ -3128,6 +4025,7 @@ Map {
     }",
                     "done": true,
                     "id": "tools",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tools",
                     "promise": Promise {},
@@ -3169,7 +4067,8 @@ Map {
   "path-types/store/inventory.types.ts" => Script {
     "cache": Map {
       "OperationTypeCoder@petstore.yaml#/paths/~1store~1inventory/get@[object Object]:true" => "HTTP_GET",
-      "tools@internal/tools.ts:true" => "Tools",
+      "ContextCoder@petstore.yaml#/paths/~1store~1inventory/get@paths/store/$context.ts:true:true" => "Context",
+      "tools@internal/tools.ts:true:false" => "Tools",
     },
     "exports": Map {
       "HTTP_GET" => Object {
@@ -3191,6 +4090,7 @@ Map {
     | void",
         "done": true,
         "id": "OperationTypeCoder@petstore.yaml#/paths/~1store~1inventory/get",
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_GET",
         "promise": Promise {},
@@ -3198,10 +4098,6 @@ Map {
       },
     },
     "externalImports": Map {
-      "Context" => Object {
-        "isType": true,
-        "modulePath": "../../context/context.js",
-      },
       "ResponseBuilderBuilder" => Object {
         "isType": true,
         "modulePath": "counterfact",
@@ -3212,7 +4108,40 @@ Map {
       },
     },
     "imports": Map {
+      "Context" => Object {
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "script": Script {
+          "cache": Map {
+            "default" => "Context",
+          },
+          "exports": Map {
+            "Context" => Object {
+              "code": Object {
+                "raw": "export { default } from \\"../$context.js\\"",
+              },
+              "done": true,
+              "id": "ContextCoder@petstore.yaml#/paths/~1store~1inventory/get",
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "promise": Promise {},
+              "typeDeclaration": "",
+            },
+          },
+          "externalImports": Map {},
+          "imports": Map {},
+          "path": "paths/store/$context.ts",
+          "repository": Repository {
+            "scripts": [Circular],
+            "writeFiles": [Function],
+          },
+          "typeCache": Map {},
+        },
+      },
       "Tools" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Tools",
         "script": Script {
@@ -3229,6 +4158,7 @@ Map {
     }",
               "done": true,
               "id": "tools",
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "promise": Promise {},
@@ -3261,7 +4191,7 @@ Map {
   "paths/store/order.ts" => Script {
     "cache": Map {
       "OperationCoder@petstore.yaml#/paths/~1store~1order/post@[object Object]:false" => "POST",
-      "OperationTypeCoder@petstore.yaml#/paths/~1store~1order/post@path-types/store/order.types.ts:true" => "HTTP_POST",
+      "OperationTypeCoder@petstore.yaml#/paths/~1store~1order/post@path-types/store/order.types.ts:true:false" => "HTTP_POST",
     },
     "exports": Map {
       "POST" => Object {
@@ -3270,6 +4200,7 @@ Map {
     }",
         "done": true,
         "id": "OperationCoder@petstore.yaml#/paths/~1store~1order/post",
+        "isDefault": false,
         "isType": false,
         "name": "POST",
         "promise": Promise {},
@@ -3279,13 +4210,15 @@ Map {
     "externalImports": Map {},
     "imports": Map {
       "HTTP_POST" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_POST",
         "script": Script {
           "cache": Map {
             "OperationTypeCoder@petstore.yaml#/paths/~1store~1order/post@[object Object]:true" => "HTTP_POST",
-            "SchemaTypeCoder@undefined@components/Order.ts:true" => "Order",
-            "tools@internal/tools.ts:true" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1store~1order/post@paths/store/$context.ts:true:true" => "Context",
+            "SchemaTypeCoder@undefined@components/Order.ts:true:false" => "Order",
+            "tools@internal/tools.ts:true:false" => "Tools",
           },
           "exports": Map {
             "HTTP_POST" => Object {
@@ -3317,6 +4250,7 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1store~1order/post",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_POST",
               "promise": Promise {},
@@ -3324,10 +4258,6 @@ Map {
             },
           },
           "externalImports": Map {
-            "Context" => Object {
-              "isType": true,
-              "modulePath": "../../context/context.js",
-            },
             "ResponseBuilderBuilder" => Object {
               "isType": true,
               "modulePath": "counterfact",
@@ -3338,7 +4268,40 @@ Map {
             },
           },
           "imports": Map {
+            "Context" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1store~1inventory/get",
+                    "isDefault": true,
+                    "isType": true,
+                    "name": "Context",
+                    "promise": Promise {},
+                    "typeDeclaration": "",
+                  },
+                },
+                "externalImports": Map {},
+                "imports": Map {},
+                "path": "paths/store/$context.ts",
+                "repository": Repository {
+                  "scripts": [Circular],
+                  "writeFiles": [Function],
+                },
+                "typeCache": Map {},
+              },
+            },
             "Order" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Order",
               "script": Script {
@@ -3350,6 +4313,7 @@ Map {
                     "code": "{id?: number,petId?: number,quantity?: number,shipDate?: string,status?: string,complete?: boolean}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Order",
                     "promise": Promise {},
@@ -3367,6 +4331,7 @@ Map {
               },
             },
             "Tools" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "script": Script {
@@ -3383,6 +4348,7 @@ Map {
     }",
                     "done": true,
                     "id": "tools",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tools",
                     "promise": Promise {},
@@ -3424,8 +4390,9 @@ Map {
   "path-types/store/order.types.ts" => Script {
     "cache": Map {
       "OperationTypeCoder@petstore.yaml#/paths/~1store~1order/post@[object Object]:true" => "HTTP_POST",
-      "SchemaTypeCoder@undefined@components/Order.ts:true" => "Order",
-      "tools@internal/tools.ts:true" => "Tools",
+      "ContextCoder@petstore.yaml#/paths/~1store~1order/post@paths/store/$context.ts:true:true" => "Context",
+      "SchemaTypeCoder@undefined@components/Order.ts:true:false" => "Order",
+      "tools@internal/tools.ts:true:false" => "Tools",
     },
     "exports": Map {
       "HTTP_POST" => Object {
@@ -3457,6 +4424,7 @@ Map {
     | void",
         "done": true,
         "id": "OperationTypeCoder@petstore.yaml#/paths/~1store~1order/post",
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_POST",
         "promise": Promise {},
@@ -3464,10 +4432,6 @@ Map {
       },
     },
     "externalImports": Map {
-      "Context" => Object {
-        "isType": true,
-        "modulePath": "../../context/context.js",
-      },
       "ResponseBuilderBuilder" => Object {
         "isType": true,
         "modulePath": "counterfact",
@@ -3478,7 +4442,40 @@ Map {
       },
     },
     "imports": Map {
+      "Context" => Object {
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "script": Script {
+          "cache": Map {
+            "default" => "Context",
+          },
+          "exports": Map {
+            "Context" => Object {
+              "code": Object {
+                "raw": "export { default } from \\"../$context.js\\"",
+              },
+              "done": true,
+              "id": "ContextCoder@petstore.yaml#/paths/~1store~1inventory/get",
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "promise": Promise {},
+              "typeDeclaration": "",
+            },
+          },
+          "externalImports": Map {},
+          "imports": Map {},
+          "path": "paths/store/$context.ts",
+          "repository": Repository {
+            "scripts": [Circular],
+            "writeFiles": [Function],
+          },
+          "typeCache": Map {},
+        },
+      },
       "Order" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Order",
         "script": Script {
@@ -3490,6 +4487,7 @@ Map {
               "code": "{id?: number,petId?: number,quantity?: number,shipDate?: string,status?: string,complete?: boolean}",
               "done": true,
               "id": "SchemaTypeCoder@undefined",
+              "isDefault": false,
               "isType": true,
               "name": "Order",
               "promise": Promise {},
@@ -3507,6 +4505,7 @@ Map {
         },
       },
       "Tools" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Tools",
         "script": Script {
@@ -3523,6 +4522,7 @@ Map {
     }",
               "done": true,
               "id": "tools",
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "promise": Promise {},
@@ -3555,9 +4555,9 @@ Map {
   "paths/store/order/{orderId}.ts" => Script {
     "cache": Map {
       "OperationCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get@[object Object]:false" => "GET",
-      "OperationTypeCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get@path-types/store/order/{orderId}.types.ts:true" => "HTTP_GET",
+      "OperationTypeCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get@path-types/store/order/{orderId}.types.ts:true:false" => "HTTP_GET",
       "OperationCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/delete@[object Object]:false" => "DELETE",
-      "OperationTypeCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/delete@path-types/store/order/{orderId}.types.ts:true" => "HTTP_DELETE",
+      "OperationTypeCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/delete@path-types/store/order/{orderId}.types.ts:true:false" => "HTTP_DELETE",
     },
     "exports": Map {
       "GET" => Object {
@@ -3566,6 +4566,7 @@ Map {
     }",
         "done": true,
         "id": "OperationCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get",
+        "isDefault": false,
         "isType": false,
         "name": "GET",
         "promise": Promise {},
@@ -3575,6 +4576,7 @@ Map {
         "code": "() => { /* no response content specified in the OpenAPI document */ }",
         "done": true,
         "id": "OperationCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/delete",
+        "isDefault": false,
         "isType": false,
         "name": "DELETE",
         "promise": Promise {},
@@ -3584,14 +4586,17 @@ Map {
     "externalImports": Map {},
     "imports": Map {
       "HTTP_GET" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_GET",
         "script": Script {
           "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",
-            "SchemaTypeCoder@undefined@components/Order.ts:true" => "Order",
-            "tools@internal/tools.ts:true" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get@paths/store/order/$context.ts:true:true" => "Context",
+            "SchemaTypeCoder@undefined@components/Order.ts:true:false" => "Order",
+            "tools@internal/tools.ts:true:false" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/delete@paths/store/order/$context.ts:true:true" => "Context2",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -3641,13 +4646,14 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_GET",
               "promise": Promise {},
               "typeDeclaration": "",
             },
             "HTTP_DELETE" => Object {
-              "code": "({ query, path, header, body, context, tools }: { query: never, path: {orderId: number}, header: never, body: undefined, context: Context, response: ResponseBuilderBuilder<{
+              "code": "({ query, path, header, body, context, tools }: { query: never, path: {orderId: number}, header: never, body: undefined, context: Context2, response: ResponseBuilderBuilder<{
       400: {
           headers: {};
           content: {
@@ -3673,6 +4679,7 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/delete",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_DELETE",
               "promise": Promise {},
@@ -3680,10 +4687,6 @@ Map {
             },
           },
           "externalImports": Map {
-            "Context" => Object {
-              "isType": true,
-              "modulePath": "../../../context/context.js",
-            },
             "ResponseBuilderBuilder" => Object {
               "isType": true,
               "modulePath": "counterfact",
@@ -3694,7 +4697,40 @@ Map {
             },
           },
           "imports": Map {
+            "Context" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get",
+                    "isDefault": true,
+                    "isType": true,
+                    "name": "Context",
+                    "promise": Promise {},
+                    "typeDeclaration": "",
+                  },
+                },
+                "externalImports": Map {},
+                "imports": Map {},
+                "path": "paths/store/order/$context.ts",
+                "repository": Repository {
+                  "scripts": [Circular],
+                  "writeFiles": [Function],
+                },
+                "typeCache": Map {},
+              },
+            },
             "Order" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Order",
               "script": Script {
@@ -3706,6 +4742,7 @@ Map {
                     "code": "{id?: number,petId?: number,quantity?: number,shipDate?: string,status?: string,complete?: boolean}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Order",
                     "promise": Promise {},
@@ -3723,6 +4760,7 @@ Map {
               },
             },
             "Tools" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "script": Script {
@@ -3739,6 +4777,7 @@ Map {
     }",
                     "done": true,
                     "id": "tools",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tools",
                     "promise": Promise {},
@@ -3760,24 +4799,59 @@ Map {
                 "typeCache": Map {},
               },
             },
-          },
-          "path": "path-types/store/order/{orderId}.types.ts",
-          "repository": Repository {
-            "scripts": [Circular],
-            "writeFiles": [Function],
-          },
-          "typeCache": Map {},
-        },
-      },
-      "HTTP_DELETE" => Object {
-        "isType": true,
+            "Context2" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get",
+                    "isDefault": true,
+                    "isType": true,
+                    "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 {
+            "scripts": [Circular],
+            "writeFiles": [Function],
+          },
+          "typeCache": Map {},
+        },
+      },
+      "HTTP_DELETE" => Object {
+        "isDefault": false,
+        "isType": true,
         "name": "HTTP_DELETE",
         "script": Script {
           "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",
-            "SchemaTypeCoder@undefined@components/Order.ts:true" => "Order",
-            "tools@internal/tools.ts:true" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get@paths/store/order/$context.ts:true:true" => "Context",
+            "SchemaTypeCoder@undefined@components/Order.ts:true:false" => "Order",
+            "tools@internal/tools.ts:true:false" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/delete@paths/store/order/$context.ts:true:true" => "Context2",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -3827,13 +4901,14 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_GET",
               "promise": Promise {},
               "typeDeclaration": "",
             },
             "HTTP_DELETE" => Object {
-              "code": "({ query, path, header, body, context, tools }: { query: never, path: {orderId: number}, header: never, body: undefined, context: Context, response: ResponseBuilderBuilder<{
+              "code": "({ query, path, header, body, context, tools }: { query: never, path: {orderId: number}, header: never, body: undefined, context: Context2, response: ResponseBuilderBuilder<{
       400: {
           headers: {};
           content: {
@@ -3859,6 +4934,7 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/delete",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_DELETE",
               "promise": Promise {},
@@ -3866,10 +4942,6 @@ Map {
             },
           },
           "externalImports": Map {
-            "Context" => Object {
-              "isType": true,
-              "modulePath": "../../../context/context.js",
-            },
             "ResponseBuilderBuilder" => Object {
               "isType": true,
               "modulePath": "counterfact",
@@ -3880,7 +4952,40 @@ Map {
             },
           },
           "imports": Map {
+            "Context" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get",
+                    "isDefault": true,
+                    "isType": true,
+                    "name": "Context",
+                    "promise": Promise {},
+                    "typeDeclaration": "",
+                  },
+                },
+                "externalImports": Map {},
+                "imports": Map {},
+                "path": "paths/store/order/$context.ts",
+                "repository": Repository {
+                  "scripts": [Circular],
+                  "writeFiles": [Function],
+                },
+                "typeCache": Map {},
+              },
+            },
             "Order" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Order",
               "script": Script {
@@ -3892,6 +4997,7 @@ Map {
                     "code": "{id?: number,petId?: number,quantity?: number,shipDate?: string,status?: string,complete?: boolean}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Order",
                     "promise": Promise {},
@@ -3909,6 +5015,7 @@ Map {
               },
             },
             "Tools" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "script": Script {
@@ -3925,6 +5032,7 @@ Map {
     }",
                     "done": true,
                     "id": "tools",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tools",
                     "promise": Promise {},
@@ -3946,6 +5054,38 @@ Map {
                 "typeCache": Map {},
               },
             },
+            "Context2" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get",
+                    "isDefault": true,
+                    "isType": true,
+                    "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 {
@@ -3967,8 +5107,10 @@ Map {
     "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",
-      "SchemaTypeCoder@undefined@components/Order.ts:true" => "Order",
-      "tools@internal/tools.ts:true" => "Tools",
+      "ContextCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get@paths/store/order/$context.ts:true:true" => "Context",
+      "SchemaTypeCoder@undefined@components/Order.ts:true:false" => "Order",
+      "tools@internal/tools.ts:true:false" => "Tools",
+      "ContextCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/delete@paths/store/order/$context.ts:true:true" => "Context2",
     },
     "exports": Map {
       "HTTP_GET" => Object {
@@ -4018,13 +5160,14 @@ Map {
     | void",
         "done": true,
         "id": "OperationTypeCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get",
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_GET",
         "promise": Promise {},
         "typeDeclaration": "",
       },
       "HTTP_DELETE" => Object {
-        "code": "({ query, path, header, body, context, tools }: { query: never, path: {orderId: number}, header: never, body: undefined, context: Context, response: ResponseBuilderBuilder<{
+        "code": "({ query, path, header, body, context, tools }: { query: never, path: {orderId: number}, header: never, body: undefined, context: Context2, response: ResponseBuilderBuilder<{
       400: {
           headers: {};
           content: {
@@ -4050,6 +5193,7 @@ Map {
     | void",
         "done": true,
         "id": "OperationTypeCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/delete",
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_DELETE",
         "promise": Promise {},
@@ -4057,10 +5201,6 @@ Map {
       },
     },
     "externalImports": Map {
-      "Context" => Object {
-        "isType": true,
-        "modulePath": "../../../context/context.js",
-      },
       "ResponseBuilderBuilder" => Object {
         "isType": true,
         "modulePath": "counterfact",
@@ -4071,7 +5211,40 @@ Map {
       },
     },
     "imports": Map {
+      "Context" => Object {
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "script": Script {
+          "cache": Map {
+            "default" => "Context",
+          },
+          "exports": Map {
+            "Context" => Object {
+              "code": Object {
+                "raw": "export { default } from \\"../$context.js\\"",
+              },
+              "done": true,
+              "id": "ContextCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get",
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "promise": Promise {},
+              "typeDeclaration": "",
+            },
+          },
+          "externalImports": Map {},
+          "imports": Map {},
+          "path": "paths/store/order/$context.ts",
+          "repository": Repository {
+            "scripts": [Circular],
+            "writeFiles": [Function],
+          },
+          "typeCache": Map {},
+        },
+      },
       "Order" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Order",
         "script": Script {
@@ -4083,6 +5256,7 @@ Map {
               "code": "{id?: number,petId?: number,quantity?: number,shipDate?: string,status?: string,complete?: boolean}",
               "done": true,
               "id": "SchemaTypeCoder@undefined",
+              "isDefault": false,
               "isType": true,
               "name": "Order",
               "promise": Promise {},
@@ -4100,6 +5274,7 @@ Map {
         },
       },
       "Tools" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Tools",
         "script": Script {
@@ -4116,6 +5291,7 @@ Map {
     }",
               "done": true,
               "id": "tools",
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "promise": Promise {},
@@ -4137,6 +5313,38 @@ Map {
           "typeCache": Map {},
         },
       },
+      "Context2" => Object {
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "script": Script {
+          "cache": Map {
+            "default" => "Context",
+          },
+          "exports": Map {
+            "Context" => Object {
+              "code": Object {
+                "raw": "export { default } from \\"../$context.js\\"",
+              },
+              "done": true,
+              "id": "ContextCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get",
+              "isDefault": true,
+              "isType": true,
+              "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 {
@@ -4148,7 +5356,7 @@ Map {
   "paths/user.ts" => Script {
     "cache": Map {
       "OperationCoder@petstore.yaml#/paths/~1user/post@[object Object]:false" => "POST",
-      "OperationTypeCoder@petstore.yaml#/paths/~1user/post@path-types/user.types.ts:true" => "HTTP_POST",
+      "OperationTypeCoder@petstore.yaml#/paths/~1user/post@path-types/user.types.ts:true:false" => "HTTP_POST",
     },
     "exports": Map {
       "POST" => Object {
@@ -4157,6 +5365,7 @@ Map {
     }",
         "done": true,
         "id": "OperationCoder@petstore.yaml#/paths/~1user/post",
+        "isDefault": false,
         "isType": false,
         "name": "POST",
         "promise": Promise {},
@@ -4166,13 +5375,15 @@ Map {
     "externalImports": Map {},
     "imports": Map {
       "HTTP_POST" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_POST",
         "script": Script {
           "cache": Map {
             "OperationTypeCoder@petstore.yaml#/paths/~1user/post@[object Object]:true" => "HTTP_POST",
-            "SchemaTypeCoder@undefined@components/User.ts:true" => "User",
-            "tools@internal/tools.ts:true" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1user/post@paths//$context.ts:true:true" => "Context",
+            "SchemaTypeCoder@undefined@components/User.ts:true:false" => "User",
+            "tools@internal/tools.ts:true:false" => "Tools",
           },
           "exports": Map {
             "HTTP_POST" => Object {
@@ -4202,6 +5413,7 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1user/post",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_POST",
               "promise": Promise {},
@@ -4209,10 +5421,6 @@ Map {
             },
           },
           "externalImports": Map {
-            "Context" => Object {
-              "isType": true,
-              "modulePath": "../context/context.js",
-            },
             "ResponseBuilderBuilder" => Object {
               "isType": true,
               "modulePath": "counterfact",
@@ -4223,7 +5431,38 @@ Map {
             },
           },
           "imports": Map {
+            "Context" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": "{}",
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1pet/post",
+                    "isDefault": true,
+                    "isType": true,
+                    "name": "Context",
+                    "promise": Promise {},
+                    "typeDeclaration": "",
+                  },
+                },
+                "externalImports": Map {},
+                "imports": Map {},
+                "path": "paths//$context.ts",
+                "repository": Repository {
+                  "scripts": [Circular],
+                  "writeFiles": [Function],
+                },
+                "typeCache": Map {},
+              },
+            },
             "User" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "User",
               "script": Script {
@@ -4235,6 +5474,7 @@ Map {
                     "code": "{id?: number,username?: string,firstName?: string,lastName?: string,email?: string,password?: string,phone?: string,userStatus?: number}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "User",
                     "promise": Promise {},
@@ -4252,6 +5492,7 @@ Map {
               },
             },
             "Tools" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "script": Script {
@@ -4268,6 +5509,7 @@ Map {
     }",
                     "done": true,
                     "id": "tools",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tools",
                     "promise": Promise {},
@@ -4309,8 +5551,9 @@ Map {
   "path-types/user.types.ts" => Script {
     "cache": Map {
       "OperationTypeCoder@petstore.yaml#/paths/~1user/post@[object Object]:true" => "HTTP_POST",
-      "SchemaTypeCoder@undefined@components/User.ts:true" => "User",
-      "tools@internal/tools.ts:true" => "Tools",
+      "ContextCoder@petstore.yaml#/paths/~1user/post@paths//$context.ts:true:true" => "Context",
+      "SchemaTypeCoder@undefined@components/User.ts:true:false" => "User",
+      "tools@internal/tools.ts:true:false" => "Tools",
     },
     "exports": Map {
       "HTTP_POST" => Object {
@@ -4340,6 +5583,7 @@ Map {
     | void",
         "done": true,
         "id": "OperationTypeCoder@petstore.yaml#/paths/~1user/post",
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_POST",
         "promise": Promise {},
@@ -4347,10 +5591,6 @@ Map {
       },
     },
     "externalImports": Map {
-      "Context" => Object {
-        "isType": true,
-        "modulePath": "../context/context.js",
-      },
       "ResponseBuilderBuilder" => Object {
         "isType": true,
         "modulePath": "counterfact",
@@ -4361,7 +5601,38 @@ Map {
       },
     },
     "imports": Map {
+      "Context" => Object {
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "script": Script {
+          "cache": Map {
+            "default" => "Context",
+          },
+          "exports": Map {
+            "Context" => Object {
+              "code": "{}",
+              "done": true,
+              "id": "ContextCoder@petstore.yaml#/paths/~1pet/post",
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "promise": Promise {},
+              "typeDeclaration": "",
+            },
+          },
+          "externalImports": Map {},
+          "imports": Map {},
+          "path": "paths//$context.ts",
+          "repository": Repository {
+            "scripts": [Circular],
+            "writeFiles": [Function],
+          },
+          "typeCache": Map {},
+        },
+      },
       "User" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "User",
         "script": Script {
@@ -4373,6 +5644,7 @@ Map {
               "code": "{id?: number,username?: string,firstName?: string,lastName?: string,email?: string,password?: string,phone?: string,userStatus?: number}",
               "done": true,
               "id": "SchemaTypeCoder@undefined",
+              "isDefault": false,
               "isType": true,
               "name": "User",
               "promise": Promise {},
@@ -4390,6 +5662,7 @@ Map {
         },
       },
       "Tools" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Tools",
         "script": Script {
@@ -4406,6 +5679,7 @@ Map {
     }",
               "done": true,
               "id": "tools",
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "promise": Promise {},
@@ -4438,7 +5712,7 @@ Map {
   "paths/user/createWithList.ts" => Script {
     "cache": Map {
       "OperationCoder@petstore.yaml#/paths/~1user~1createWithList/post@[object Object]:false" => "POST",
-      "OperationTypeCoder@petstore.yaml#/paths/~1user~1createWithList/post@path-types/user/createWithList.types.ts:true" => "HTTP_POST",
+      "OperationTypeCoder@petstore.yaml#/paths/~1user~1createWithList/post@path-types/user/createWithList.types.ts:true:false" => "HTTP_POST",
     },
     "exports": Map {
       "POST" => Object {
@@ -4447,6 +5721,7 @@ Map {
     }",
         "done": true,
         "id": "OperationCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+        "isDefault": false,
         "isType": false,
         "name": "POST",
         "promise": Promise {},
@@ -4456,13 +5731,15 @@ Map {
     "externalImports": Map {},
     "imports": Map {
       "HTTP_POST" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_POST",
         "script": Script {
           "cache": Map {
             "OperationTypeCoder@petstore.yaml#/paths/~1user~1createWithList/post@[object Object]:true" => "HTTP_POST",
-            "SchemaTypeCoder@undefined@components/User.ts:true" => "User",
-            "tools@internal/tools.ts:true" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post@paths/user/$context.ts:true:true" => "Context",
+            "SchemaTypeCoder@undefined@components/User.ts:true:false" => "User",
+            "tools@internal/tools.ts:true:false" => "Tools",
           },
           "exports": Map {
             "HTTP_POST" => Object {
@@ -4502,6 +5779,7 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_POST",
               "promise": Promise {},
@@ -4509,10 +5787,6 @@ Map {
             },
           },
           "externalImports": Map {
-            "Context" => Object {
-              "isType": true,
-              "modulePath": "../../context/context.js",
-            },
             "ResponseBuilderBuilder" => Object {
               "isType": true,
               "modulePath": "counterfact",
@@ -4523,7 +5797,40 @@ Map {
             },
           },
           "imports": Map {
+            "Context" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+                    "isDefault": true,
+                    "isType": true,
+                    "name": "Context",
+                    "promise": Promise {},
+                    "typeDeclaration": "",
+                  },
+                },
+                "externalImports": Map {},
+                "imports": Map {},
+                "path": "paths/user/$context.ts",
+                "repository": Repository {
+                  "scripts": [Circular],
+                  "writeFiles": [Function],
+                },
+                "typeCache": Map {},
+              },
+            },
             "User" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "User",
               "script": Script {
@@ -4535,6 +5842,7 @@ Map {
                     "code": "{id?: number,username?: string,firstName?: string,lastName?: string,email?: string,password?: string,phone?: string,userStatus?: number}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "User",
                     "promise": Promise {},
@@ -4552,6 +5860,7 @@ Map {
               },
             },
             "Tools" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "script": Script {
@@ -4568,6 +5877,7 @@ Map {
     }",
                     "done": true,
                     "id": "tools",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tools",
                     "promise": Promise {},
@@ -4609,8 +5919,9 @@ Map {
   "path-types/user/createWithList.types.ts" => Script {
     "cache": Map {
       "OperationTypeCoder@petstore.yaml#/paths/~1user~1createWithList/post@[object Object]:true" => "HTTP_POST",
-      "SchemaTypeCoder@undefined@components/User.ts:true" => "User",
-      "tools@internal/tools.ts:true" => "Tools",
+      "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post@paths/user/$context.ts:true:true" => "Context",
+      "SchemaTypeCoder@undefined@components/User.ts:true:false" => "User",
+      "tools@internal/tools.ts:true:false" => "Tools",
     },
     "exports": Map {
       "HTTP_POST" => Object {
@@ -4650,6 +5961,7 @@ Map {
     | void",
         "done": true,
         "id": "OperationTypeCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_POST",
         "promise": Promise {},
@@ -4657,10 +5969,6 @@ Map {
       },
     },
     "externalImports": Map {
-      "Context" => Object {
-        "isType": true,
-        "modulePath": "../../context/context.js",
-      },
       "ResponseBuilderBuilder" => Object {
         "isType": true,
         "modulePath": "counterfact",
@@ -4671,7 +5979,40 @@ Map {
       },
     },
     "imports": Map {
+      "Context" => Object {
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "script": Script {
+          "cache": Map {
+            "default" => "Context",
+          },
+          "exports": Map {
+            "Context" => Object {
+              "code": Object {
+                "raw": "export { default } from \\"../$context.js\\"",
+              },
+              "done": true,
+              "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "promise": Promise {},
+              "typeDeclaration": "",
+            },
+          },
+          "externalImports": Map {},
+          "imports": Map {},
+          "path": "paths/user/$context.ts",
+          "repository": Repository {
+            "scripts": [Circular],
+            "writeFiles": [Function],
+          },
+          "typeCache": Map {},
+        },
+      },
       "User" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "User",
         "script": Script {
@@ -4683,6 +6024,7 @@ Map {
               "code": "{id?: number,username?: string,firstName?: string,lastName?: string,email?: string,password?: string,phone?: string,userStatus?: number}",
               "done": true,
               "id": "SchemaTypeCoder@undefined",
+              "isDefault": false,
               "isType": true,
               "name": "User",
               "promise": Promise {},
@@ -4700,6 +6042,7 @@ Map {
         },
       },
       "Tools" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Tools",
         "script": Script {
@@ -4716,6 +6059,7 @@ Map {
     }",
               "done": true,
               "id": "tools",
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "promise": Promise {},
@@ -4748,7 +6092,7 @@ Map {
   "paths/user/login.ts" => Script {
     "cache": Map {
       "OperationCoder@petstore.yaml#/paths/~1user~1login/get@[object Object]:false" => "GET",
-      "OperationTypeCoder@petstore.yaml#/paths/~1user~1login/get@path-types/user/login.types.ts:true" => "HTTP_GET",
+      "OperationTypeCoder@petstore.yaml#/paths/~1user~1login/get@path-types/user/login.types.ts:true:false" => "HTTP_GET",
     },
     "exports": Map {
       "GET" => Object {
@@ -4757,6 +6101,7 @@ Map {
     }",
         "done": true,
         "id": "OperationCoder@petstore.yaml#/paths/~1user~1login/get",
+        "isDefault": false,
         "isType": false,
         "name": "GET",
         "promise": Promise {},
@@ -4766,12 +6111,14 @@ Map {
     "externalImports": Map {},
     "imports": Map {
       "HTTP_GET" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_GET",
         "script": Script {
           "cache": Map {
             "OperationTypeCoder@petstore.yaml#/paths/~1user~1login/get@[object Object]:true" => "HTTP_GET",
-            "tools@internal/tools.ts:true" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1user~1login/get@paths/user/$context.ts:true:true" => "Context",
+            "tools@internal/tools.ts:true:false" => "Tools",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -4811,6 +6158,7 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1user~1login/get",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_GET",
               "promise": Promise {},
@@ -4818,10 +6166,6 @@ Map {
             },
           },
           "externalImports": Map {
-            "Context" => Object {
-              "isType": true,
-              "modulePath": "../../context/context.js",
-            },
             "ResponseBuilderBuilder" => Object {
               "isType": true,
               "modulePath": "counterfact",
@@ -4832,7 +6176,40 @@ Map {
             },
           },
           "imports": Map {
+            "Context" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+                    "isDefault": true,
+                    "isType": true,
+                    "name": "Context",
+                    "promise": Promise {},
+                    "typeDeclaration": "",
+                  },
+                },
+                "externalImports": Map {},
+                "imports": Map {},
+                "path": "paths/user/$context.ts",
+                "repository": Repository {
+                  "scripts": [Circular],
+                  "writeFiles": [Function],
+                },
+                "typeCache": Map {},
+              },
+            },
             "Tools" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "script": Script {
@@ -4849,6 +6226,7 @@ Map {
     }",
                     "done": true,
                     "id": "tools",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tools",
                     "promise": Promise {},
@@ -4890,7 +6268,8 @@ Map {
   "path-types/user/login.types.ts" => Script {
     "cache": Map {
       "OperationTypeCoder@petstore.yaml#/paths/~1user~1login/get@[object Object]:true" => "HTTP_GET",
-      "tools@internal/tools.ts:true" => "Tools",
+      "ContextCoder@petstore.yaml#/paths/~1user~1login/get@paths/user/$context.ts:true:true" => "Context",
+      "tools@internal/tools.ts:true:false" => "Tools",
     },
     "exports": Map {
       "HTTP_GET" => Object {
@@ -4930,6 +6309,7 @@ Map {
     | void",
         "done": true,
         "id": "OperationTypeCoder@petstore.yaml#/paths/~1user~1login/get",
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_GET",
         "promise": Promise {},
@@ -4937,10 +6317,6 @@ Map {
       },
     },
     "externalImports": Map {
-      "Context" => Object {
-        "isType": true,
-        "modulePath": "../../context/context.js",
-      },
       "ResponseBuilderBuilder" => Object {
         "isType": true,
         "modulePath": "counterfact",
@@ -4951,7 +6327,40 @@ Map {
       },
     },
     "imports": Map {
+      "Context" => Object {
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "script": Script {
+          "cache": Map {
+            "default" => "Context",
+          },
+          "exports": Map {
+            "Context" => Object {
+              "code": Object {
+                "raw": "export { default } from \\"../$context.js\\"",
+              },
+              "done": true,
+              "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "promise": Promise {},
+              "typeDeclaration": "",
+            },
+          },
+          "externalImports": Map {},
+          "imports": Map {},
+          "path": "paths/user/$context.ts",
+          "repository": Repository {
+            "scripts": [Circular],
+            "writeFiles": [Function],
+          },
+          "typeCache": Map {},
+        },
+      },
       "Tools" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Tools",
         "script": Script {
@@ -4968,6 +6377,7 @@ Map {
     }",
               "done": true,
               "id": "tools",
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "promise": Promise {},
@@ -5000,13 +6410,14 @@ Map {
   "paths/user/logout.ts" => Script {
     "cache": Map {
       "OperationCoder@petstore.yaml#/paths/~1user~1logout/get@[object Object]:false" => "GET",
-      "OperationTypeCoder@petstore.yaml#/paths/~1user~1logout/get@path-types/user/logout.types.ts:true" => "HTTP_GET",
+      "OperationTypeCoder@petstore.yaml#/paths/~1user~1logout/get@path-types/user/logout.types.ts:true:false" => "HTTP_GET",
     },
     "exports": Map {
       "GET" => Object {
         "code": "() => { /* no response content specified in the OpenAPI document */ }",
         "done": true,
         "id": "OperationCoder@petstore.yaml#/paths/~1user~1logout/get",
+        "isDefault": false,
         "isType": false,
         "name": "GET",
         "promise": Promise {},
@@ -5016,12 +6427,14 @@ Map {
     "externalImports": Map {},
     "imports": Map {
       "HTTP_GET" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_GET",
         "script": Script {
           "cache": Map {
             "OperationTypeCoder@petstore.yaml#/paths/~1user~1logout/get@[object Object]:true" => "HTTP_GET",
-            "tools@internal/tools.ts:true" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1user~1logout/get@paths/user/$context.ts:true:true" => "Context",
+            "tools@internal/tools.ts:true:false" => "Tools",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -5041,6 +6454,7 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1user~1logout/get",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_GET",
               "promise": Promise {},
@@ -5048,10 +6462,6 @@ Map {
             },
           },
           "externalImports": Map {
-            "Context" => Object {
-              "isType": true,
-              "modulePath": "../../context/context.js",
-            },
             "ResponseBuilderBuilder" => Object {
               "isType": true,
               "modulePath": "counterfact",
@@ -5062,7 +6472,40 @@ Map {
             },
           },
           "imports": Map {
+            "Context" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+                    "isDefault": true,
+                    "isType": true,
+                    "name": "Context",
+                    "promise": Promise {},
+                    "typeDeclaration": "",
+                  },
+                },
+                "externalImports": Map {},
+                "imports": Map {},
+                "path": "paths/user/$context.ts",
+                "repository": Repository {
+                  "scripts": [Circular],
+                  "writeFiles": [Function],
+                },
+                "typeCache": Map {},
+              },
+            },
             "Tools" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "script": Script {
@@ -5079,6 +6522,7 @@ Map {
     }",
                     "done": true,
                     "id": "tools",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tools",
                     "promise": Promise {},
@@ -5120,7 +6564,8 @@ Map {
   "path-types/user/logout.types.ts" => Script {
     "cache": Map {
       "OperationTypeCoder@petstore.yaml#/paths/~1user~1logout/get@[object Object]:true" => "HTTP_GET",
-      "tools@internal/tools.ts:true" => "Tools",
+      "ContextCoder@petstore.yaml#/paths/~1user~1logout/get@paths/user/$context.ts:true:true" => "Context",
+      "tools@internal/tools.ts:true:false" => "Tools",
     },
     "exports": Map {
       "HTTP_GET" => Object {
@@ -5140,6 +6585,7 @@ Map {
     | void",
         "done": true,
         "id": "OperationTypeCoder@petstore.yaml#/paths/~1user~1logout/get",
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_GET",
         "promise": Promise {},
@@ -5147,10 +6593,6 @@ Map {
       },
     },
     "externalImports": Map {
-      "Context" => Object {
-        "isType": true,
-        "modulePath": "../../context/context.js",
-      },
       "ResponseBuilderBuilder" => Object {
         "isType": true,
         "modulePath": "counterfact",
@@ -5161,7 +6603,40 @@ Map {
       },
     },
     "imports": Map {
+      "Context" => Object {
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "script": Script {
+          "cache": Map {
+            "default" => "Context",
+          },
+          "exports": Map {
+            "Context" => Object {
+              "code": Object {
+                "raw": "export { default } from \\"../$context.js\\"",
+              },
+              "done": true,
+              "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "promise": Promise {},
+              "typeDeclaration": "",
+            },
+          },
+          "externalImports": Map {},
+          "imports": Map {},
+          "path": "paths/user/$context.ts",
+          "repository": Repository {
+            "scripts": [Circular],
+            "writeFiles": [Function],
+          },
+          "typeCache": Map {},
+        },
+      },
       "Tools" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Tools",
         "script": Script {
@@ -5178,6 +6653,7 @@ Map {
     }",
               "done": true,
               "id": "tools",
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "promise": Promise {},
@@ -5210,11 +6686,11 @@ Map {
   "paths/user/{username}.ts" => Script {
     "cache": Map {
       "OperationCoder@petstore.yaml#/paths/~1user~1{username}/get@[object Object]:false" => "GET",
-      "OperationTypeCoder@petstore.yaml#/paths/~1user~1{username}/get@path-types/user/{username}.types.ts:true" => "HTTP_GET",
+      "OperationTypeCoder@petstore.yaml#/paths/~1user~1{username}/get@path-types/user/{username}.types.ts:true:false" => "HTTP_GET",
       "OperationCoder@petstore.yaml#/paths/~1user~1{username}/put@[object Object]:false" => "PUT",
-      "OperationTypeCoder@petstore.yaml#/paths/~1user~1{username}/put@path-types/user/{username}.types.ts:true" => "HTTP_PUT",
+      "OperationTypeCoder@petstore.yaml#/paths/~1user~1{username}/put@path-types/user/{username}.types.ts:true:false" => "HTTP_PUT",
       "OperationCoder@petstore.yaml#/paths/~1user~1{username}/delete@[object Object]:false" => "DELETE",
-      "OperationTypeCoder@petstore.yaml#/paths/~1user~1{username}/delete@path-types/user/{username}.types.ts:true" => "HTTP_DELETE",
+      "OperationTypeCoder@petstore.yaml#/paths/~1user~1{username}/delete@path-types/user/{username}.types.ts:true:false" => "HTTP_DELETE",
     },
     "exports": Map {
       "GET" => Object {
@@ -5223,6 +6699,7 @@ Map {
     }",
         "done": true,
         "id": "OperationCoder@petstore.yaml#/paths/~1user~1{username}/get",
+        "isDefault": false,
         "isType": false,
         "name": "GET",
         "promise": Promise {},
@@ -5232,6 +6709,7 @@ Map {
         "code": "() => { /* no response content specified in the OpenAPI document */ }",
         "done": true,
         "id": "OperationCoder@petstore.yaml#/paths/~1user~1{username}/put",
+        "isDefault": false,
         "isType": false,
         "name": "PUT",
         "promise": Promise {},
@@ -5241,6 +6719,7 @@ Map {
         "code": "() => { /* no response content specified in the OpenAPI document */ }",
         "done": true,
         "id": "OperationCoder@petstore.yaml#/paths/~1user~1{username}/delete",
+        "isDefault": false,
         "isType": false,
         "name": "DELETE",
         "promise": Promise {},
@@ -5250,6 +6729,7 @@ Map {
     "externalImports": Map {},
     "imports": Map {
       "HTTP_GET" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_GET",
         "script": Script {
@@ -5257,8 +6737,11 @@ Map {
             "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",
-            "SchemaTypeCoder@undefined@components/User.ts:true" => "User",
-            "tools@internal/tools.ts:true" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1user~1{username}/get@paths/user/$context.ts:true:true" => "Context",
+            "SchemaTypeCoder@undefined@components/User.ts:true:false" => "User",
+            "tools@internal/tools.ts:true:false" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1user~1{username}/put@paths/user/$context.ts:true:true" => "Context2",
+            "ContextCoder@petstore.yaml#/paths/~1user~1{username}/delete@paths/user/$context.ts:true:true" => "Context3",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -5308,13 +6791,14 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1user~1{username}/get",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_GET",
               "promise": Promise {},
               "typeDeclaration": "",
             },
             "HTTP_PUT" => Object {
-              "code": "({ query, path, header, body, context, tools }: { query: never, path: {username: string}, header: never, body: User, context: Context, response: ResponseBuilderBuilder<{
+              "code": "({ query, path, header, body, context, tools }: { query: never, path: {username: string}, header: never, body: User, context: Context2, response: ResponseBuilderBuilder<{
       [statusCode in HttpStatusCode]: {
           headers: {};
           content: {
@@ -5330,13 +6814,14 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1user~1{username}/put",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_PUT",
               "promise": Promise {},
               "typeDeclaration": "",
             },
             "HTTP_DELETE" => Object {
-              "code": "({ query, path, header, body, context, tools }: { query: never, path: {username: string}, header: never, body: undefined, context: Context, response: ResponseBuilderBuilder<{
+              "code": "({ query, path, header, body, context, tools }: { query: never, path: {username: string}, header: never, body: undefined, context: Context3, response: ResponseBuilderBuilder<{
       400: {
           headers: {};
           content: {
@@ -5362,6 +6847,7 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1user~1{username}/delete",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_DELETE",
               "promise": Promise {},
@@ -5369,10 +6855,6 @@ Map {
             },
           },
           "externalImports": Map {
-            "Context" => Object {
-              "isType": true,
-              "modulePath": "../../context/context.js",
-            },
             "ResponseBuilderBuilder" => Object {
               "isType": true,
               "modulePath": "counterfact",
@@ -5383,7 +6865,40 @@ Map {
             },
           },
           "imports": Map {
+            "Context" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+                    "isDefault": true,
+                    "isType": true,
+                    "name": "Context",
+                    "promise": Promise {},
+                    "typeDeclaration": "",
+                  },
+                },
+                "externalImports": Map {},
+                "imports": Map {},
+                "path": "paths/user/$context.ts",
+                "repository": Repository {
+                  "scripts": [Circular],
+                  "writeFiles": [Function],
+                },
+                "typeCache": Map {},
+              },
+            },
             "User" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "User",
               "script": Script {
@@ -5395,6 +6910,7 @@ Map {
                     "code": "{id?: number,username?: string,firstName?: string,lastName?: string,email?: string,password?: string,phone?: string,userStatus?: number}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "User",
                     "promise": Promise {},
@@ -5412,6 +6928,7 @@ Map {
               },
             },
             "Tools" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "script": Script {
@@ -5428,6 +6945,7 @@ Map {
     }",
                     "done": true,
                     "id": "tools",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tools",
                     "promise": Promise {},
@@ -5449,6 +6967,70 @@ Map {
                 "typeCache": Map {},
               },
             },
+            "Context2" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+                    "isDefault": true,
+                    "isType": true,
+                    "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": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+                    "isDefault": true,
+                    "isType": true,
+                    "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 {
@@ -5459,6 +7041,7 @@ Map {
         },
       },
       "HTTP_PUT" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_PUT",
         "script": Script {
@@ -5466,8 +7049,11 @@ Map {
             "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",
-            "SchemaTypeCoder@undefined@components/User.ts:true" => "User",
-            "tools@internal/tools.ts:true" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1user~1{username}/get@paths/user/$context.ts:true:true" => "Context",
+            "SchemaTypeCoder@undefined@components/User.ts:true:false" => "User",
+            "tools@internal/tools.ts:true:false" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1user~1{username}/put@paths/user/$context.ts:true:true" => "Context2",
+            "ContextCoder@petstore.yaml#/paths/~1user~1{username}/delete@paths/user/$context.ts:true:true" => "Context3",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -5517,13 +7103,14 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1user~1{username}/get",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_GET",
               "promise": Promise {},
               "typeDeclaration": "",
             },
             "HTTP_PUT" => Object {
-              "code": "({ query, path, header, body, context, tools }: { query: never, path: {username: string}, header: never, body: User, context: Context, response: ResponseBuilderBuilder<{
+              "code": "({ query, path, header, body, context, tools }: { query: never, path: {username: string}, header: never, body: User, context: Context2, response: ResponseBuilderBuilder<{
       [statusCode in HttpStatusCode]: {
           headers: {};
           content: {
@@ -5539,13 +7126,14 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1user~1{username}/put",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_PUT",
               "promise": Promise {},
               "typeDeclaration": "",
             },
             "HTTP_DELETE" => Object {
-              "code": "({ query, path, header, body, context, tools }: { query: never, path: {username: string}, header: never, body: undefined, context: Context, response: ResponseBuilderBuilder<{
+              "code": "({ query, path, header, body, context, tools }: { query: never, path: {username: string}, header: never, body: undefined, context: Context3, response: ResponseBuilderBuilder<{
       400: {
           headers: {};
           content: {
@@ -5571,6 +7159,7 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1user~1{username}/delete",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_DELETE",
               "promise": Promise {},
@@ -5578,10 +7167,6 @@ Map {
             },
           },
           "externalImports": Map {
-            "Context" => Object {
-              "isType": true,
-              "modulePath": "../../context/context.js",
-            },
             "ResponseBuilderBuilder" => Object {
               "isType": true,
               "modulePath": "counterfact",
@@ -5592,7 +7177,40 @@ Map {
             },
           },
           "imports": Map {
+            "Context" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+                    "isDefault": true,
+                    "isType": true,
+                    "name": "Context",
+                    "promise": Promise {},
+                    "typeDeclaration": "",
+                  },
+                },
+                "externalImports": Map {},
+                "imports": Map {},
+                "path": "paths/user/$context.ts",
+                "repository": Repository {
+                  "scripts": [Circular],
+                  "writeFiles": [Function],
+                },
+                "typeCache": Map {},
+              },
+            },
             "User" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "User",
               "script": Script {
@@ -5604,6 +7222,7 @@ Map {
                     "code": "{id?: number,username?: string,firstName?: string,lastName?: string,email?: string,password?: string,phone?: string,userStatus?: number}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "User",
                     "promise": Promise {},
@@ -5621,6 +7240,7 @@ Map {
               },
             },
             "Tools" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "script": Script {
@@ -5637,6 +7257,7 @@ Map {
     }",
                     "done": true,
                     "id": "tools",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tools",
                     "promise": Promise {},
@@ -5658,6 +7279,70 @@ Map {
                 "typeCache": Map {},
               },
             },
+            "Context2" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+                    "isDefault": true,
+                    "isType": true,
+                    "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": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+                    "isDefault": true,
+                    "isType": true,
+                    "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 {
@@ -5668,6 +7353,7 @@ Map {
         },
       },
       "HTTP_DELETE" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_DELETE",
         "script": Script {
@@ -5675,8 +7361,11 @@ Map {
             "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",
-            "SchemaTypeCoder@undefined@components/User.ts:true" => "User",
-            "tools@internal/tools.ts:true" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1user~1{username}/get@paths/user/$context.ts:true:true" => "Context",
+            "SchemaTypeCoder@undefined@components/User.ts:true:false" => "User",
+            "tools@internal/tools.ts:true:false" => "Tools",
+            "ContextCoder@petstore.yaml#/paths/~1user~1{username}/put@paths/user/$context.ts:true:true" => "Context2",
+            "ContextCoder@petstore.yaml#/paths/~1user~1{username}/delete@paths/user/$context.ts:true:true" => "Context3",
           },
           "exports": Map {
             "HTTP_GET" => Object {
@@ -5726,13 +7415,14 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1user~1{username}/get",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_GET",
               "promise": Promise {},
               "typeDeclaration": "",
             },
             "HTTP_PUT" => Object {
-              "code": "({ query, path, header, body, context, tools }: { query: never, path: {username: string}, header: never, body: User, context: Context, response: ResponseBuilderBuilder<{
+              "code": "({ query, path, header, body, context, tools }: { query: never, path: {username: string}, header: never, body: User, context: Context2, response: ResponseBuilderBuilder<{
       [statusCode in HttpStatusCode]: {
           headers: {};
           content: {
@@ -5748,13 +7438,14 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1user~1{username}/put",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_PUT",
               "promise": Promise {},
               "typeDeclaration": "",
             },
             "HTTP_DELETE" => Object {
-              "code": "({ query, path, header, body, context, tools }: { query: never, path: {username: string}, header: never, body: undefined, context: Context, response: ResponseBuilderBuilder<{
+              "code": "({ query, path, header, body, context, tools }: { query: never, path: {username: string}, header: never, body: undefined, context: Context3, response: ResponseBuilderBuilder<{
       400: {
           headers: {};
           content: {
@@ -5780,6 +7471,7 @@ Map {
     | void",
               "done": true,
               "id": "OperationTypeCoder@petstore.yaml#/paths/~1user~1{username}/delete",
+              "isDefault": false,
               "isType": true,
               "name": "HTTP_DELETE",
               "promise": Promise {},
@@ -5787,10 +7479,6 @@ Map {
             },
           },
           "externalImports": Map {
-            "Context" => Object {
-              "isType": true,
-              "modulePath": "../../context/context.js",
-            },
             "ResponseBuilderBuilder" => Object {
               "isType": true,
               "modulePath": "counterfact",
@@ -5801,7 +7489,40 @@ Map {
             },
           },
           "imports": Map {
+            "Context" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+                    "isDefault": true,
+                    "isType": true,
+                    "name": "Context",
+                    "promise": Promise {},
+                    "typeDeclaration": "",
+                  },
+                },
+                "externalImports": Map {},
+                "imports": Map {},
+                "path": "paths/user/$context.ts",
+                "repository": Repository {
+                  "scripts": [Circular],
+                  "writeFiles": [Function],
+                },
+                "typeCache": Map {},
+              },
+            },
             "User" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "User",
               "script": Script {
@@ -5813,6 +7534,7 @@ Map {
                     "code": "{id?: number,username?: string,firstName?: string,lastName?: string,email?: string,password?: string,phone?: string,userStatus?: number}",
                     "done": true,
                     "id": "SchemaTypeCoder@undefined",
+                    "isDefault": false,
                     "isType": true,
                     "name": "User",
                     "promise": Promise {},
@@ -5830,6 +7552,7 @@ Map {
               },
             },
             "Tools" => Object {
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "script": Script {
@@ -5846,6 +7569,7 @@ Map {
     }",
                     "done": true,
                     "id": "tools",
+                    "isDefault": false,
                     "isType": true,
                     "name": "Tools",
                     "promise": Promise {},
@@ -5867,6 +7591,70 @@ Map {
                 "typeCache": Map {},
               },
             },
+            "Context2" => Object {
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+                    "isDefault": true,
+                    "isType": true,
+                    "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": true,
+              "name": "Context",
+              "script": Script {
+                "cache": Map {
+                  "default" => "Context",
+                },
+                "exports": Map {
+                  "Context" => Object {
+                    "code": Object {
+                      "raw": "export { default } from \\"../$context.js\\"",
+                    },
+                    "done": true,
+                    "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+                    "isDefault": true,
+                    "isType": true,
+                    "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 {
@@ -5889,8 +7677,11 @@ Map {
       "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",
-      "SchemaTypeCoder@undefined@components/User.ts:true" => "User",
-      "tools@internal/tools.ts:true" => "Tools",
+      "ContextCoder@petstore.yaml#/paths/~1user~1{username}/get@paths/user/$context.ts:true:true" => "Context",
+      "SchemaTypeCoder@undefined@components/User.ts:true:false" => "User",
+      "tools@internal/tools.ts:true:false" => "Tools",
+      "ContextCoder@petstore.yaml#/paths/~1user~1{username}/put@paths/user/$context.ts:true:true" => "Context2",
+      "ContextCoder@petstore.yaml#/paths/~1user~1{username}/delete@paths/user/$context.ts:true:true" => "Context3",
     },
     "exports": Map {
       "HTTP_GET" => Object {
@@ -5940,13 +7731,14 @@ Map {
     | void",
         "done": true,
         "id": "OperationTypeCoder@petstore.yaml#/paths/~1user~1{username}/get",
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_GET",
         "promise": Promise {},
         "typeDeclaration": "",
       },
       "HTTP_PUT" => Object {
-        "code": "({ query, path, header, body, context, tools }: { query: never, path: {username: string}, header: never, body: User, context: Context, response: ResponseBuilderBuilder<{
+        "code": "({ query, path, header, body, context, tools }: { query: never, path: {username: string}, header: never, body: User, context: Context2, response: ResponseBuilderBuilder<{
       [statusCode in HttpStatusCode]: {
           headers: {};
           content: {
@@ -5962,13 +7754,14 @@ Map {
     | void",
         "done": true,
         "id": "OperationTypeCoder@petstore.yaml#/paths/~1user~1{username}/put",
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_PUT",
         "promise": Promise {},
         "typeDeclaration": "",
       },
       "HTTP_DELETE" => Object {
-        "code": "({ query, path, header, body, context, tools }: { query: never, path: {username: string}, header: never, body: undefined, context: Context, response: ResponseBuilderBuilder<{
+        "code": "({ query, path, header, body, context, tools }: { query: never, path: {username: string}, header: never, body: undefined, context: Context3, response: ResponseBuilderBuilder<{
       400: {
           headers: {};
           content: {
@@ -5994,6 +7787,7 @@ Map {
     | void",
         "done": true,
         "id": "OperationTypeCoder@petstore.yaml#/paths/~1user~1{username}/delete",
+        "isDefault": false,
         "isType": true,
         "name": "HTTP_DELETE",
         "promise": Promise {},
@@ -6001,10 +7795,6 @@ Map {
       },
     },
     "externalImports": Map {
-      "Context" => Object {
-        "isType": true,
-        "modulePath": "../../context/context.js",
-      },
       "ResponseBuilderBuilder" => Object {
         "isType": true,
         "modulePath": "counterfact",
@@ -6015,7 +7805,40 @@ Map {
       },
     },
     "imports": Map {
+      "Context" => Object {
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "script": Script {
+          "cache": Map {
+            "default" => "Context",
+          },
+          "exports": Map {
+            "Context" => Object {
+              "code": Object {
+                "raw": "export { default } from \\"../$context.js\\"",
+              },
+              "done": true,
+              "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+              "isDefault": true,
+              "isType": true,
+              "name": "Context",
+              "promise": Promise {},
+              "typeDeclaration": "",
+            },
+          },
+          "externalImports": Map {},
+          "imports": Map {},
+          "path": "paths/user/$context.ts",
+          "repository": Repository {
+            "scripts": [Circular],
+            "writeFiles": [Function],
+          },
+          "typeCache": Map {},
+        },
+      },
       "User" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "User",
         "script": Script {
@@ -6027,6 +7850,7 @@ Map {
               "code": "{id?: number,username?: string,firstName?: string,lastName?: string,email?: string,password?: string,phone?: string,userStatus?: number}",
               "done": true,
               "id": "SchemaTypeCoder@undefined",
+              "isDefault": false,
               "isType": true,
               "name": "User",
               "promise": Promise {},
@@ -6044,6 +7868,7 @@ Map {
         },
       },
       "Tools" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Tools",
         "script": Script {
@@ -6060,6 +7885,7 @@ Map {
     }",
               "done": true,
               "id": "tools",
+              "isDefault": false,
               "isType": true,
               "name": "Tools",
               "promise": Promise {},
@@ -6081,6 +7907,70 @@ Map {
           "typeCache": Map {},
         },
       },
+      "Context2" => Object {
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "script": Script {
+          "cache": Map {
+            "default" => "Context",
+          },
+          "exports": Map {
+            "Context" => Object {
+              "code": Object {
+                "raw": "export { default } from \\"../$context.js\\"",
+              },
+              "done": true,
+              "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+              "isDefault": true,
+              "isType": true,
+              "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": true,
+        "name": "Context",
+        "script": Script {
+          "cache": Map {
+            "default" => "Context",
+          },
+          "exports": Map {
+            "Context" => Object {
+              "code": Object {
+                "raw": "export { default } from \\"../$context.js\\"",
+              },
+              "done": true,
+              "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+              "isDefault": true,
+              "isType": true,
+              "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 {
@@ -6089,17 +7979,43 @@ Map {
     },
     "typeCache": Map {},
   },
+  "paths//$context.ts" => Script {
+    "cache": Map {
+      "default" => "Context",
+    },
+    "exports": Map {
+      "Context" => Object {
+        "code": "{}",
+        "done": true,
+        "id": "ContextCoder@petstore.yaml#/paths/~1pet/post",
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "promise": Promise {},
+        "typeDeclaration": "",
+      },
+    },
+    "externalImports": Map {},
+    "imports": Map {},
+    "path": "paths//$context.ts",
+    "repository": Repository {
+      "scripts": [Circular],
+      "writeFiles": [Function],
+    },
+    "typeCache": Map {},
+  },
   "components/Pet.ts" => Script {
     "cache": Map {
       "SchemaTypeCoder@undefined@[object Object]:true" => "Pet",
-      "SchemaTypeCoder@undefined@components/Category.ts:true" => "Category",
-      "SchemaTypeCoder@undefined@components/Tag.ts:true" => "Tag",
+      "SchemaTypeCoder@undefined@components/Category.ts:true:false" => "Category",
+      "SchemaTypeCoder@undefined@components/Tag.ts:true:false" => "Tag",
     },
     "exports": Map {
       "Pet" => Object {
         "code": "{id?: number,name: string,category?: Category,photoUrls: Array<string>,tags?: Array<Tag>,status?: string}",
         "done": true,
         "id": "SchemaTypeCoder@undefined",
+        "isDefault": false,
         "isType": true,
         "name": "Pet",
         "promise": Promise {},
@@ -6109,6 +8025,7 @@ Map {
     "externalImports": Map {},
     "imports": Map {
       "Category" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Category",
         "script": Script {
@@ -6120,6 +8037,7 @@ Map {
               "code": "{id?: number,name?: string}",
               "done": true,
               "id": "SchemaTypeCoder@undefined",
+              "isDefault": false,
               "isType": true,
               "name": "Category",
               "promise": Promise {},
@@ -6137,6 +8055,7 @@ Map {
         },
       },
       "Tag" => Object {
+        "isDefault": false,
         "isType": true,
         "name": "Tag",
         "script": Script {
@@ -6148,6 +8067,7 @@ Map {
               "code": "{id?: number,name?: string}",
               "done": true,
               "id": "SchemaTypeCoder@undefined",
+              "isDefault": false,
               "isType": true,
               "name": "Tag",
               "promise": Promise {},
@@ -6186,6 +8106,7 @@ Map {
     }",
         "done": true,
         "id": "tools",
+        "isDefault": false,
         "isType": true,
         "name": "Tools",
         "promise": Promise {},
@@ -6206,6 +8127,60 @@ Map {
     },
     "typeCache": Map {},
   },
+  "paths/pet/$context.ts" => Script {
+    "cache": Map {
+      "default" => "Context",
+    },
+    "exports": Map {
+      "Context" => Object {
+        "code": Object {
+          "raw": "export { default } from \\"../$context.js\\"",
+        },
+        "done": true,
+        "id": "ContextCoder@petstore.yaml#/paths/~1pet~1findByStatus/get",
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "promise": Promise {},
+        "typeDeclaration": "",
+      },
+    },
+    "externalImports": Map {},
+    "imports": Map {},
+    "path": "paths/pet/$context.ts",
+    "repository": Repository {
+      "scripts": [Circular],
+      "writeFiles": [Function],
+    },
+    "typeCache": Map {},
+  },
+  "paths/pet/{petId}/$context.ts" => Script {
+    "cache": Map {
+      "default" => "Context",
+    },
+    "exports": Map {
+      "Context" => Object {
+        "code": Object {
+          "raw": "export { default } from \\"../$context.js\\"",
+        },
+        "done": true,
+        "id": "ContextCoder@petstore.yaml#/paths/~1pet~1{petId}~1uploadImage/post",
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "promise": Promise {},
+        "typeDeclaration": "",
+      },
+    },
+    "externalImports": Map {},
+    "imports": Map {},
+    "path": "paths/pet/{petId}/$context.ts",
+    "repository": Repository {
+      "scripts": [Circular],
+      "writeFiles": [Function],
+    },
+    "typeCache": Map {},
+  },
   "components/ApiResponse.ts" => Script {
     "cache": Map {
       "SchemaTypeCoder@undefined@[object Object]:true" => "ApiResponse",
@@ -6215,6 +8190,7 @@ Map {
         "code": "{code?: number,type?: string,message?: string}",
         "done": true,
         "id": "SchemaTypeCoder@undefined",
+        "isDefault": false,
         "isType": true,
         "name": "ApiResponse",
         "promise": Promise {},
@@ -6230,6 +8206,33 @@ Map {
     },
     "typeCache": Map {},
   },
+  "paths/store/$context.ts" => Script {
+    "cache": Map {
+      "default" => "Context",
+    },
+    "exports": Map {
+      "Context" => Object {
+        "code": Object {
+          "raw": "export { default } from \\"../$context.js\\"",
+        },
+        "done": true,
+        "id": "ContextCoder@petstore.yaml#/paths/~1store~1inventory/get",
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "promise": Promise {},
+        "typeDeclaration": "",
+      },
+    },
+    "externalImports": Map {},
+    "imports": Map {},
+    "path": "paths/store/$context.ts",
+    "repository": Repository {
+      "scripts": [Circular],
+      "writeFiles": [Function],
+    },
+    "typeCache": Map {},
+  },
   "components/Order.ts" => Script {
     "cache": Map {
       "SchemaTypeCoder@undefined@[object Object]:true" => "Order",
@@ -6239,6 +8242,7 @@ Map {
         "code": "{id?: number,petId?: number,quantity?: number,shipDate?: string,status?: string,complete?: boolean}",
         "done": true,
         "id": "SchemaTypeCoder@undefined",
+        "isDefault": false,
         "isType": true,
         "name": "Order",
         "promise": Promise {},
@@ -6254,6 +8258,33 @@ Map {
     },
     "typeCache": Map {},
   },
+  "paths/store/order/$context.ts" => Script {
+    "cache": Map {
+      "default" => "Context",
+    },
+    "exports": Map {
+      "Context" => Object {
+        "code": Object {
+          "raw": "export { default } from \\"../$context.js\\"",
+        },
+        "done": true,
+        "id": "ContextCoder@petstore.yaml#/paths/~1store~1order~1{orderId}/get",
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "promise": Promise {},
+        "typeDeclaration": "",
+      },
+    },
+    "externalImports": Map {},
+    "imports": Map {},
+    "path": "paths/store/order/$context.ts",
+    "repository": Repository {
+      "scripts": [Circular],
+      "writeFiles": [Function],
+    },
+    "typeCache": Map {},
+  },
   "components/User.ts" => Script {
     "cache": Map {
       "SchemaTypeCoder@undefined@[object Object]:true" => "User",
@@ -6263,6 +8294,7 @@ Map {
         "code": "{id?: number,username?: string,firstName?: string,lastName?: string,email?: string,password?: string,phone?: string,userStatus?: number}",
         "done": true,
         "id": "SchemaTypeCoder@undefined",
+        "isDefault": false,
         "isType": true,
         "name": "User",
         "promise": Promise {},
@@ -6278,6 +8310,33 @@ Map {
     },
     "typeCache": Map {},
   },
+  "paths/user/$context.ts" => Script {
+    "cache": Map {
+      "default" => "Context",
+    },
+    "exports": Map {
+      "Context" => Object {
+        "code": Object {
+          "raw": "export { default } from \\"../$context.js\\"",
+        },
+        "done": true,
+        "id": "ContextCoder@petstore.yaml#/paths/~1user~1createWithList/post",
+        "isDefault": true,
+        "isType": true,
+        "name": "Context",
+        "promise": Promise {},
+        "typeDeclaration": "",
+      },
+    },
+    "externalImports": Map {},
+    "imports": Map {},
+    "path": "paths/user/$context.ts",
+    "repository": Repository {
+      "scripts": [Circular],
+      "writeFiles": [Function],
+    },
+    "typeCache": Map {},
+  },
   "components/Category.ts" => Script {
     "cache": Map {
       "SchemaTypeCoder@undefined@[object Object]:true" => "Category",
@@ -6287,6 +8346,7 @@ Map {
         "code": "{id?: number,name?: string}",
         "done": true,
         "id": "SchemaTypeCoder@undefined",
+        "isDefault": false,
         "isType": true,
         "name": "Category",
         "promise": Promise {},
@@ -6311,6 +8371,7 @@ Map {
         "code": "{id?: number,name?: string}",
         "done": true,
         "id": "SchemaTypeCoder@undefined",
+        "isDefault": false,
         "isType": true,
         "name": "Tag",
         "promise": Promise {},
diff --git a/test/typescript-generator/__snapshots__/operation-type-coder.test.js.snap b/test/typescript-generator/__snapshots__/operation-type-coder.test.js.snap
index 80afb70..683ef9c 100644
--- a/test/typescript-generator/__snapshots__/operation-type-coder.test.js.snap
+++ b/test/typescript-generator/__snapshots__/operation-type-coder.test.js.snap
@@ -13,7 +13,7 @@ exports[`an OperationTypeCoder generates a complex post operation 1`] = `
   path: { id?: string };
   header: { name?: string };
   body: Type;
-  context: Context;
+  context: default;
   response: ResponseBuilderBuilder<{
     200: {
       headers: {};
@@ -75,7 +75,7 @@ exports[`an OperationTypeCoder generates a simple get operation 1`] = `
   path: undefined;
   header: undefined;
   body: undefined;
-  context: Context;
+  context: default;
   response: ResponseBuilderBuilder<{
     [statusCode in HttpStatusCode]: {
       headers: {};
diff --git a/test/typescript-generator/operation-type-coder.test.js b/test/typescript-generator/operation-type-coder.test.js
index 4a96ee3..4ae03a5 100644
--- a/test/typescript-generator/operation-type-coder.test.js
+++ b/test/typescript-generator/operation-type-coder.test.js
@@ -11,6 +11,10 @@ function format(code) {
 const dummyScript = {
   path: ".",
 
+  importDefault() {
+    return "default";
+  },
+
   importExternalType() {
     return "ExternalType";
   },
diff --git a/test/typescript-generator/script.test.js b/test/typescript-generator/script.test.js
index a930c02..e24e6b3 100644
--- a/test/typescript-generator/script.test.js
+++ b/test/typescript-generator/script.test.js
@@ -62,6 +62,7 @@ describe("a Script", () => {
       script: exportingScript,
       name: "Account",
       isType: false,
+      isDefault: false,
     });
   });
 
@@ -89,10 +90,12 @@ describe("a Script", () => {
 
     script.import(coder);
     script.importType(coder);
+    script.importDefault(coder);
 
     expect(script.importStatements()).toStrictEqual([
       'import { Account0 } from "./export-from-me.js";',
       'import type { Account1 } from "./export-from-me.js";',
+      'import type Account2 from "./export-from-me.js";',
     ]);
   });
 
@@ -120,12 +123,14 @@ describe("a Script", () => {
 
     script.export(coder);
     script.exportType(coder);
+    script.exportDefault(coder);
 
     await script.finished();
 
     expect(script.exportStatements()).toStrictEqual([
       "export const Account0 = { };",
       "export type Account1 = { };",
+      "export default { };",
     ]);
   });
 
@@ -136,10 +141,13 @@ describe("a Script", () => {
 
     script.importStatements = () => ["import { foo } from './foo.js;"];
 
-    script.exportStatements = () => ['export const bar = "Bar";'];
+    script.exportStatements = () => [
+      'export const bar = "Bar";',
+      "export default class {};",
+    ];
 
     expect(script.contents()).toBe(
-      'import { foo } from \'./foo.js;\nexport const bar = "Bar";'
+      'import { foo } from \'./foo.js;\nexport const bar = "Bar";\nexport default class {};'
     );
   });
 });
diff --git a/test/typescript-generator/todo.txt b/test/typescript-generator/todo.txt
deleted file mode 100644
index b425d11..0000000
--- a/test/typescript-generator/todo.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-The rest can become Github issues
-
-- convert to TypeScript 
-- name collisions between imports and exports
-- import { exportName as localName }
-- CLI
-- convert to monorepo
-- unit tests
-- fix generated code so that it passes ESLint
-- consistently import node:path as nodePath 
-- refactor ugly stuff like `this.requirement.url.split("/").at(-1)`
-- make sure it works if the spec is in multiple files
-
-
-