Skip to content

Commit

Permalink
fix(cli): changelog IDs are now unique within a section (#4725)
Browse files Browse the repository at this point in the history
  • Loading branch information
armandobelardo authored Sep 23, 2024
1 parent 38da479 commit 5d7971c
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 34 deletions.
76 changes: 44 additions & 32 deletions packages/cli/cli/versions.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
- changelogEntry:
- summary: |
The OpenAPI importer now correctly propagates the title field on `oneof` schemas.
The documentation resolver now approrpiately creates a unique identifier for changelog sections. Previously, if you had multiple
changelogs within the same section, despite their title and slug being different, they would be treated as the same section since the ID
only took into account the parents' slug, appended the word "changelog" and that was all.
As a result previously all changelogs within the same section would get highlighted when one was selected, now only the selected changelog
is highlighted.
type: internal
irVersion: 53
version: 0.42.15

- changelogEntry:
- summary: |
The OpenAPI importer now correctly propagates the title field on `oneof` schemas.
type: fix
irVersion: 53
version: 0.42.14
Expand All @@ -13,44 +25,44 @@
irVersion: 53
version: 0.42.13

- changelogEntry:
- summary: |
- changelogEntry:
- summary: |
Previously, deploying docs from Windows machines led to bad asset paths.
Now, the CLI respects Windows paths during run and web paths for retrieving
assets.
type: fix
irVersion: 53
version: 0.42.12

- changelogEntry:
- summary: |
The API V2 configuration now supports disabling using titles as schema
- changelogEntry:
- summary: |
The API V2 configuration now supports disabling using titles as schema
names. You may want to disable this flag if your OpenAPI adds the same
title to multiple schemas.
title to multiple schemas.
```
api:
specs:
api:
specs:
- openapi: /path/to/openapi
settings:
settings:
use-title-as-schema-name: false
```
type: fix
irVersion: 53
version: 0.42.11

- changelogEntry:
- summary: |
Previously, the OpenAPI converter would bring over `title` on every
single property. This field is extraneous, so now we ignore it.
- changelogEntry:
- summary: |
Previously, the OpenAPI converter would bring over `title` on every
single property. This field is extraneous, so now we ignore it.
type: fix
irVersion: 53
version: 0.42.10

- changelogEntry:
- summary: |
Previously, the OpenAPI importer would ignore skip parsing arbitrary
content types "*/*". Now it treats this content type as application/json.
- changelogEntry:
- summary: |
Previously, the OpenAPI importer would ignore skip parsing arbitrary
content types "*/*". Now it treats this content type as application/json.
```json openapi.json
"responses": {
Expand All @@ -63,35 +75,35 @@
irVersion: 53
version: 0.42.9

- changelogEntry:
- summary: |
- changelogEntry:
- summary: |
The API V2 configuration (in beta) now supports global header overrides.
This fixes a bug where those header overrides were getting dropped in
This fixes a bug where those header overrides were getting dropped in
certain cases.
```yml generators.yml
api:
headers:
api:
headers:
X-API-VERSION: string
specs:
specs:
- openapi: /path/to/openapi
overrides: /path/to/overrides
```
type: fix
irVersion: 53
version: 0.42.8

- changelogEntry:
- summary: |
The API V2 configuration (in beta) now supports global header
overrides. To specify global headers that are not in your
OpenAPI spec, simply add the following block in your `generators.yml`:
- changelogEntry:
- summary: |
The API V2 configuration (in beta) now supports global header
overrides. To specify global headers that are not in your
OpenAPI spec, simply add the following block in your `generators.yml`:
```yml generators.yml
api:
headers:
api:
headers:
X-API-VERSION: string
specs:
specs:
- openapi: /path/to/openapi
overrides: /path/to/overrides
```
Expand Down
6 changes: 4 additions & 2 deletions packages/cli/docs-resolver/src/DocsDefinitionResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ export class DocsDefinitionResolver {
};
}
case "changelog": {
const idgen = NodeIdGenerator.init(parentSlug.get());
const slug = item.slug ?? kebabCase(item.title);
const idgen = NodeIdGenerator.init(parentSlug.get()).append(slug);
const node = new ChangelogNodeConverter(
this.markdownFilesToFullSlugs,
item.changelog,
Expand All @@ -419,13 +420,14 @@ export class DocsDefinitionResolver {
hidden: item.hidden,
slug: item.slug
});

return {
type: "changelogV3",
node: node ?? {
id: idgen.append("changelog").get(),
type: "changelog",
title: item.title,
slug: parentSlug.append(item.slug ?? kebabCase(item.title)).get(),
slug: parentSlug.append(slug).get(),
children: []
}
};
Expand Down

0 comments on commit 5d7971c

Please sign in to comment.