Skip to content

fix(docs): always emit single top-level docs.json#202

Merged
raphael merged 1 commit into
v3from
fix/docs-single-output
Sep 14, 2025
Merged

fix(docs): always emit single top-level docs.json#202
raphael merged 1 commit into
v3from
fix/docs-single-output

Conversation

@raphael
Copy link
Copy Markdown
Member

@raphael raphael commented Sep 14, 2025

This PR standardizes the docs plugin output and resolves $ref inlining inconsistencies in multi‑package designs.

Summary

  • Always emit a single aggregated gen/docs.json regardless of number of roots
  • Preserve JSON tag transforms and $ref inlining across multi‑package builds
  • Deterministically merge services and definitions across roots
  • Remove per‑API (service‑scoped) gen/http/<API>/docs.json emission
  • Update tests to reflect single‑file output

Rationale
Goa designs declare a single API. Emitting per‑API docs under gen/http/<API>/docs.json created path inconsistency and consumer confusion. It also made $ref inlining appear unreliable when scripts consumed the legacy gen/docs.json. This change restores the expected single top‑level output and keeps inlining behavior correct by scoping OpenAPI definitions per root during aggregation.

Notes

  • README already documents top‑level docs.json; no changes needed.
  • The output path is now stable across single‑ and multi‑package designs.
  • Verified in a real multi‑package project:
    • gen/docs.json produced with zero $ref occurrences
    • No service‑scoped doc is emitted

- Emit only gen/docs.json regardless of number of roots
- Preserve JSON tag transforms and  inlining across multi-package builds
- Merge services and definitions across roots deterministically
- Remove per-API service-scoped path emission
- Update tests to expect a single file

Rationale: Goa designs have a single API; per-API path caused confusion and inconsistent consumer behavior. This change standardizes the output location and resolves  inlining discrepancies observed in multi-package designs (e.g., Aura).
@raphael raphael merged commit c64042d into v3 Sep 14, 2025
5 checks passed
@raphael raphael deleted the fix/docs-single-output branch September 14, 2025 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant