Generates everything the configuration asks for: the SDK and its e2e tests
when output is set, and the Swagger document when swagger is set.
It throws when neither output nor swagger.output is configured.
contracts/common.md#principled-implementation The SDK validation is attached only when an SDK is generated, so a Swagger-only run does not fail on SDK rules, and the e2e tests are generated after the SDK they import.
contracts/common.md#clear-and-simple-design One method that composes the generators inside the shared pipeline.
contracts/common.md#prohibited-implementation-shortcuts The error names the properties a caller can configure; none is stale.
Generates the SDK and the automatic e2e test functions.
It throws when output or e2e is missing, or when the parent directory
of either does not exist.
contracts/common.md#principled-implementation The e2e functions import the generated SDK, so the SDK is generated first, and both parent directories are asserted before any analysis runs.
contracts/common.md#prohibited-implementation-shortcuts The directory check follows the configuration and no path is special-cased.
contracts/common.md#meaningful-documentation The comment states the requirements and the failures.
contracts/portability.md#os-neutral-implementation path.resolve obtains each native parent and fs.stat follows symlinks to verify a directory before analysis. ENOENT/ENOTDIR become configuration diagnostics; permission and other filesystem errors propagate without a platform-specific shell fallback.
Generates the SDK library.
It throws when output is missing or its parent directory does not exist.
contracts/common.md#principled-implementation The SDK validation runs after route typing and before the generator, so a route the SDK cannot express is reported instead of written.
contracts/common.md#prohibited-implementation-shortcuts The directory check follows the configuration.
Generates the Swagger document.
It throws when swagger.output is missing or the directory that will hold
the document does not exist; the output may be a file or a directory.
contracts/common.md#principled-implementation The directory to check is the parent of a file path with an extension and the path itself otherwise, which is how the generator decides where to write.
contracts/common.md#prohibited-implementation-shortcuts The rule is the generator's own output rule.
contracts/common.md#meaningful-documentation The comment states the requirement and the two output forms.
contracts/portability.md#os-neutral-implementation path.parse/resolve decide the native containing directory from whether the output has an extension, matching SwaggerGenerator's destination rule. The common directory check distinguishes missing paths from non-directory entries and propagates other filesystem errors.
Runs the generators of
@nestia/sdkover one configuration.Each method validates the configuration for the output it needs, analyzes the controllers and the TypeScript metadata, reports every error at once, and then generates.
Evidence
contracts/common.md#principled-implementation The shared pipeline reflects controllers, types routes from transform metadata, assigns accessors and rejects collected analysis errors before writing. SDK-specific representability checks are attached by sdk and SDK-producing all; e2e currently invokes the SDK writer without that additional validation callback.
Evidence
contracts/common.md#clear-and-simple-design One class with four public generators over one private pipeline; directory assertion, title, and error report are module-private helpers.
Evidence
contracts/common.md#prohibited-implementation-shortcuts No controller or route name is special-cased; the same pipeline serves the CLI and programmatic callers.
Evidence
contracts/common.md#meaningful-documentation The comment states the four generators and that the errors of an analysis are reported together.
Evidence
contracts/portability.md#os-neutral-implementation Output checks and diagnostic locations use Node fs.stat and path operations; controller compilation and output writes remain owned by ConfigAnalyzer and the generators. Filesystem errors distinguish missing/non-directory locations from other native failures.