Skip to content
This repository was archived by the owner on Jun 18, 2023. It is now read-only.

Commit 9c3cf8e

Browse files
committed
fix: Handle primitive array data types
1 parent 04b1de7 commit 9c3cf8e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app/shared/asyncapi-mapper.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,15 @@ export class AsyncApiMapperService {
174174
}
175175

176176
private mapSchema(schemaName: string, schema: ServerAsyncApiSchema): Schema {
177+
const anchorUrl = schema.$ref ? AsyncApiMapperService.BASE_URL + schema.$ref?.split('/')?.pop() : undefined
177178
const properties = schema.properties !== undefined ? this.mapSchemas(schema.properties) : undefined
178179
const items = schema.items !== undefined ? this.mapSchema(schema.$ref+"[]", schema.items) : undefined;
179180
const example = schema.example !== undefined ? new Example(schema.example) : undefined
180181
return {
181182
name: schema.$ref,
182183
description: schema.description,
183184
anchorIdentifier: '#' + schemaName,
184-
anchorUrl: AsyncApiMapperService.BASE_URL + schema.$ref?.split('/')?.pop(),
185+
anchorUrl: anchorUrl,
185186
type: schema.type,
186187
items: items,
187188
format: schema.format,

0 commit comments

Comments
 (0)