# Schema with an Array of Objects doesn't show correct object type in array

**URL:** <https://community.smartbear.com/t/schema-with-an-array-of-objects-doesnt-show-correct-object-type-in-array/233>\
**Category:** Swagger OS\
**Tags:** api, migrated, swagger-oss\
**Created:** [August 25, 2020, 7:23pm UTC](https://community.smartbear.com/t/schema-with-an-array-of-objects-doesnt-show-correct-object-type-in-array/233 "2020-08-25T19:23:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [August 25, 2020, 7:23pm UTC](https://community.smartbear.com/t/schema-with-an-array-of-objects-doesnt-show-correct-object-type-in-array/233/1 "2020-08-25T19:23:58Z")

</div>

> Originally posted by **aevans04** on August 25, 2020

I am trying to create schema for array of objects and have produced a simple test with the JSON below (sorry that this wysiwyg doesn’t format it well). For testing I paste the below into swagger online editor [https://editor.swagger.io/#/](https://editor.swagger.io/#/) (it converts my JSON to YAML. didn’t want to post YAML into this forum wysiwyg because it was removing tabs).

It shows the CatalogsArray has being an array of objects with type name = CatalogsArray (but it does have the proper Catalog type fields) instead of having type name = Catalog:

CatalogsArray [

**CatalogsArray** {  
id integer  
title string  
}

]

If I reference the Catalog type for lastcatalog field in object called CatalogUser then type name = Catalog assigned to lastcatalog field is correct:

CatalogUser{  
username string  
lastcatalog **Catalog** {  
id integer  
title string  
}  
}

**Anybody have any idea if there is something else I have to define when setting up array of objects to get proper object type name to show up?**

{  
“openapi”: “3.0.0”,  
“info”: {  
“version”: “1.0.0”,  
“title”: “Testing Array of Objects”  
},  
“paths”: {},  
“components”: {  
“schemas”: {  
“Catalog”: {  
“type”: “object”,  
“properties”: {  
“id”: {  
“type”: “integer”  
},  
“title”: {  
“type”: “string”  
}  
}  
},  
“CatalogUser”: {  
“type”: “object”,  
“properties”: {  
“username”: {  
“type”: “string”  
},  
“lastcatalog”: {  
“$ref”: “#/components/schemas/Catalog”  
}  
}  
},  
“CatalogsArray”: {  
“type”: “array”,  
“items”: {  
“$ref”: “#/components/schemas/Catalog”  
}  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [August 25, 2020, 9:36pm UTC](https://community.smartbear.com/t/schema-with-an-array-of-objects-doesnt-show-correct-object-type-in-array/233/2 "2020-08-25T21:36:57Z")

</div>

> Originally posted by **HKosova** on August 25, 2020

Hi aevans04,

Thanks for the report. This is a known issue with rendering of array schemas:

[https://github.com/swagger-api/swagger-ui/issues/5276](https://github.com/swagger-api/swagger-ui/issues/5276)

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [October 7, 2026, 5:13pm UTC](https://community.smartbear.com/t/schema-with-an-array-of-objects-doesnt-show-correct-object-type-in-array/233/3 "2026-10-07T17:13:45Z")

</div>

Closed on October 7, 2026, 5:13pm UTC

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
