Skip to content

Commit a205928

Browse files
committed
feat!: Replace json schema renderer
1 parent b6c7fa0 commit a205928

File tree

118 files changed

+14330
-15675
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+14330
-15675
lines changed

.eslintignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,4 @@ node_modules
1010
/build
1111
/cache
1212
/coverage
13-
14-
/src/__tests__
15-
/jest.snapshots.js
16-
/jest.config.js
17-
1813
/external
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# ADR-001: Disable automatic JSON Schema `$ref` resolution in the Swagger parser
2+
3+
## Status
4+
Accepted
5+
6+
## Context
7+
Our Swagger parser used to eagerly resolve every `$ref`, including the ones that belong to the JSON Schema portion of an OpenAPI document. After the parser expanded a reference, the rendering layer had to reconstruct it back into a standalone entity so we could present it as a separate table/cut block rather than an inline object. This round trip was brittle: we lost original identifiers, broke reusability, and risked mismatches between documentation and the source schema.
8+
9+
## Decision
10+
We forbid the Swagger parser from auto-resolving `$ref` definitions that live in the JSON Schema section. References are now passed through untouched, and any unfolding happens explicitly inside the rendering/normalization layer when needed.
11+
12+
## Consequences
13+
✅ Preserve original entity identifiers, allowing us to render them as independent blocks.
14+
✅ No need to “re-fold” `$ref` or rely on heuristics to rebuild the links.
15+
✅ Easier to map documentation output back to the source schema.
16+
❌ Rendering/normalization must explicitly call `resolveRef` when it truly needs to inspect a referenced schema.
17+
18+
## Alternatives Considered
19+
1. Keep resolving all `$ref` in the parser and store extra metadata to reconstruct references later.
20+
- Drawback: dramatically complicates the intermediate representation and duplicates schema data.
21+
2. Perform partial resolution using an allowlist/denylist.
22+
- Drawback: hard to maintain and easy to miss new scenarios.
23+
24+

jest.config.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

jest.snapshots.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)