Skip to content

Commit

Permalink
fix(ui): render array refs correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
timonback committed Aug 18, 2024
1 parent fb623b9 commit 817af7b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

.description {
overflow: auto;
margin-bottom: -1em;
}

.example {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
<!-- array of refs -->
<span
class="type text-console"
*ngIf="value?.type == 'array' && value?.items?.anchorUrl"
*ngIf="value?.type == 'array' && value?.items?.refTitle"
>
<mat-chip-set>
<a [href]="value.items.anchorUrl">
<a [href]="value.items.refAnchorUrl">
<mat-chip>
<mat-icon matChipAvatar fontIcon="schema" />
{{ value.items.refTitle }}[]
Expand All @@ -68,7 +68,7 @@
<!-- array of primitive -->
<span
class="type text-console"
*ngIf="value?.type == 'array' && !value?.items?.anchorUrl"
*ngIf="value?.type == 'array' && !value?.items?.refTitle"
>
{{ value.items.type }}[]
</span>
Expand Down
1 change: 1 addition & 0 deletions springwolf-ui/src/app/models/schema.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface Schema {
// type == ref
refAnchorUrl?: string;
refName?: string;
refTitle?: string;
// type == object
properties?: { [key: string]: Schema };
required?: string[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ export class AsyncApiMapperService {
// type == ref
refAnchorUrl: AsyncApiMapperService.BASE_URL + schemaRefId,
refName: schemaRefId,
refTitle: this.resolveTitleFromName(schemaRefId),
};
}

Expand Down

0 comments on commit 817af7b

Please sign in to comment.