Azure / Azure/azure-rest-api-specs

[TypeSpecValidation] Compile should fail if generated swaggers are outside org folder

Open
#38,544 0 comments 0 reactions 1 assignee Claimed by @mikeharder View on GitHub
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
3d 2h
Merged PRs (30d)
424

Description

Some existing specs have invalid values for setting "emitter-output-dir", like "{output-dir}". This causes "tsp compile" to generate swaggers in the repo root, **outside** the organization folder. Which further confuses rules like Compile, into not detecting that the actual spec swaggers aren't being updated.

Example: https://github.com/Azure/azure-rest-api-specs-pr/actions/runs/16562512692/job/46834910004#step:4:200

To prevent this, if any generated swaggers are outside the org folder (e.g. `specification/widget`), fail immediately. Specs should **never** write outside their org folder. Any failures should be fixed, not suppressed.

Even further, if we detect the spec is folder structure v2, we can enforce that all swaggers are written under the **current** folder, not just the org folder.

Related:
- #38543

Spec Fixes:
- https://github.com/Azure/azure-rest-api-specs-pr/pull/25271

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.