我有一个集合响应,它返回一组用户对象,并希望在不创建多个用户对象的情况下为用户属性设置不同的值。有没有办法做到这一点?
# Group Users
## Users Collection [/api/v1/users]
### View Users [GET]
+ Request (application/vnd.api+json)
+ Headers
Accept: application/vnd.api+json
Authorization: Bearer JWT
+ Response 200 (application/vnd.api+json)
+ Attributes
+ meta (UsersMetaData)
+ data (array[User, User])
+ links (UserLinks)
# Data Structures
## User
+ type: users (string, required, fixed)
+ id: 1 (number, required)
+ attributes (UserAttributes, required)
## UserAttributes
+ email: test@test.com (string)
+ confirmed: false (boolean)
+ first_name: Melanie (string)
我不想创建多个用户数据结构以避免过载。但也许有一种方法可以创建示例数组或以简单的方式做到这一点?