# Files.attributes.size in swagger docs declared as string but it appeared to be int. So what's the type of it should be?

**URL:** <https://forum.social.plus/t/files-attributes-size-in-swagger-docs-declared-as-string-but-it-appeared-to-be-int-so-whats-the-type-of-it-should-be/1340>\
**Category:** Web\
**Created:** [June 7, 2024, 7:02am UTC](https://forum.social.plus/t/files-attributes-size-in-swagger-docs-declared-as-string-but-it-appeared-to-be-int-so-whats-the-type-of-it-should-be/1340 "2024-06-07T07:02:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![abogoslavets](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@abogoslavets](https://forum.social.plus/u/abogoslavets)\
**Post date:** [June 7, 2024, 7:02am UTC](https://forum.social.plus/t/files-attributes-size-in-swagger-docs-declared-as-string-but-it-appeared-to-be-int-so-whats-the-type-of-it-should-be/1340/1 "2024-06-07T07:02:43Z")

</div>

ERROR posting signals to Amity: error while getting session: json: cannot unmarshal number into Go struct field .files.attributes.size of type string

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [June 7, 2024, 9:23am UTC](https://forum.social.plus/t/files-attributes-size-in-swagger-docs-declared-as-string-but-it-appeared-to-be-int-so-whats-the-type-of-it-should-be/1340/2 "2024-06-07T09:23:06Z")

</div>

Hello, to help us better understand the issue, could you please provide the specific endpoint you are experiencing problems with, along with a sample cURL command you’re using? Thank you.

---

<div class="post-metadata">

**Author:** ![abogoslavets](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@abogoslavets](https://forum.social.plus/u/abogoslavets)\
**Post date:** [June 13, 2024, 9:21am UTC](https://forum.social.plus/t/files-attributes-size-in-swagger-docs-declared-as-string-but-it-appeared-to-be-int-so-whats-the-type-of-it-should-be/1340/3 "2024-06-13T09:21:08Z")

</div>

POST[/api/v4/images](https://api-docs.amity.co/#/File/post_api_v4_images)  
it’s the swagger response with size string

```auto
[
  {
    "fileId": "string",
    "fileUrl": "string",
    "type": "image",
    "createdAt": "2024-06-13T06:39:29.468Z",
    "updatedAt": "2024-06-13T06:39:29.468Z",
    "attributes": {
      "name": "test.jpeg",
      "extension": "jpeg",
      "size": "2107842",
      "mimeType": "image/jpeg",
      "metadata": {
        "height": 0,
        "width": 0,
        "isFull": true
      }
    }
  }
]

```

we receive it like this  
“files”: [  
{  
“fileId”: “37ba4145c5c8427da316c7eea185b0f3”,  
“fileUrl”: “[https://api.eu.amity.co/api/v3/files/37ba4145c5c8427da316c7eea185b0f3/download](https://api.eu.amity.co/api/v3/files/37ba4145c5c8427da316c7eea185b0f3/download)”,  
“type”: “image”,  
“createdAt”: “2024-04-18T07:13:39.137Z”,  
“updatedAt”: “2024-04-18T07:30:06.087Z”,  
“attributes”: {  
“name”: “image-2024-04-18-10-02-37-664.png”,  
“extension”: “png”,  
“size”: 5880,  
“mimeType”: “image/png”,  
“metadata”: {  
“height”: 225,  
“width”: 225,  
“isFull”: false  
}  
}  
},

is it okay? what’s the size type should be?

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [June 13, 2024, 11:28am UTC](https://forum.social.plus/t/files-attributes-size-in-swagger-docs-declared-as-string-but-it-appeared-to-be-int-so-whats-the-type-of-it-should-be/1340/4 "2024-06-13T11:28:31Z")

</div>

Hello, please continue following the current response as it is correct. We will inform the team to update our API documentation. We apologize for any inconvenience.

---

<div class="post-metadata">

**Author:** ![abogoslavets](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@abogoslavets](https://forum.social.plus/u/abogoslavets)\
**Post date:** [June 13, 2024, 11:43am UTC](https://forum.social.plus/t/files-attributes-size-in-swagger-docs-declared-as-string-but-it-appeared-to-be-int-so-whats-the-type-of-it-should-be/1340/5 "2024-06-13T11:43:53Z")

</div>

Okay, thanks! Can you confirm please that size parameter from files.attributes.size is int in every files-related endpoints and we can use it?

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [June 13, 2024, 12:13pm UTC](https://forum.social.plus/t/files-attributes-size-in-swagger-docs-declared-as-string-but-it-appeared-to-be-int-so-whats-the-type-of-it-should-be/1340/6 "2024-06-13T12:13:52Z")

</div>

Hello, yes, file size-related attributes should be integers. If you encounter any other endpoints where there is a discrepancy between our API documentation and the actual response, we recommend sticking with the actual response. Please feel free to reach out if you face any issues.
