typespec1-8 Exercise 1: Output Location, Names and an Option =================================================================== tspconfig_ex1.yaml (this file lives in the ex/ folder, so {project-root} is ex/): output-dir: "{project-root}/generated/api" emit: - "@typespec/openapi3" options: "@typespec/openapi3": emitter-output-dir: "{output-dir}" file-type: [yaml, json] output-file: "book-service.{file-type}" openapi-versions: - 3.1.0 Compiled with: tsp compile books.tsp --config ex/tspconfig_ex1.yaml --list-files ✔ @typespec/openapi3 51ms ex/generated/api/ ex/generated/api/book-service.yaml ex/generated/api/book-service.json Both files were written under generated/api with the names asked for. Then omit-unreachable-types: true was added (tspconfig_ex1b.yaml) and the YAML compared with the first: diff of the two YAML files: no output, they are identical. WHAT HAPPENED Nothing changed. That is the right result for this service: every model in it (Book, CreateBook, BookMergePatchUpdate, NotFound, BadRequest, ApiError) is used by an operation, and the option only removes models that no operation reaches. The chapter's own example had an Unused model, and there the option removed it. I did not check what omit-unreachable-types does to models used only through a template argument; the Book Service has none. WHY THIS WORKS AS AN ANSWER --------------------------- The option's name says what it does; the test is whether the thing it would remove exists. Reading the diff, even when it is empty, is the check.