|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace App\Swagger\schemas; |
| 4 | + |
| 5 | +use OpenApi\Attributes as OA; |
| 6 | + |
| 7 | +#[OA\Schema( |
| 8 | + schema: 'User', |
| 9 | + title: 'User', |
| 10 | + description: 'User serialized representation (private)', |
| 11 | + type: 'object', |
| 12 | + allOf: [ |
| 13 | + new OA\Schema(ref: '#/components/schemas/BaseUser'), |
| 14 | + new OA\Schema( |
| 15 | + type: 'object', |
| 16 | + properties: [ |
| 17 | + new OA\Property(property: 'email', type: 'string', format: 'email', description: 'Primary email address'), |
| 18 | + new OA\Property(property: 'identifier', type: 'string', description: 'User unique identifier string'), |
| 19 | + new OA\Property(property: 'email_verified', type: 'boolean', description: 'Whether the primary email is verified'), |
| 20 | + new OA\Property(property: 'bio', type: 'string', nullable: true, description: 'User biography'), |
| 21 | + new OA\Property(property: 'address1', type: 'string', description: 'Address line 1'), |
| 22 | + new OA\Property(property: 'address2', type: 'string', nullable: true, description: 'Address line 2'), |
| 23 | + new OA\Property(property: 'city', type: 'string', description: 'City'), |
| 24 | + new OA\Property(property: 'state', type: 'string', description: 'State or province'), |
| 25 | + new OA\Property(property: 'post_code', type: 'string', description: 'Postal code'), |
| 26 | + new OA\Property(property: 'country_iso_code', type: 'string', description: 'ISO country code'), |
| 27 | + new OA\Property(property: 'second_email', type: 'string', format: 'email', nullable: true, description: 'Secondary email address'), |
| 28 | + new OA\Property(property: 'third_email', type: 'string', format: 'email', nullable: true, description: 'Tertiary email address'), |
| 29 | + new OA\Property(property: 'gender', type: 'string', nullable: true, description: 'Gender'), |
| 30 | + new OA\Property(property: 'gender_specify', type: 'string', nullable: true, description: 'Gender specification'), |
| 31 | + new OA\Property(property: 'statement_of_interest', type: 'string', nullable: true, description: 'Statement of interest'), |
| 32 | + new OA\Property(property: 'irc', type: 'string', nullable: true, description: 'IRC handle'), |
| 33 | + new OA\Property(property: 'linked_in_profile', type: 'string', nullable: true, description: 'LinkedIn profile URL'), |
| 34 | + new OA\Property(property: 'github_user', type: 'string', nullable: true, description: 'GitHub username'), |
| 35 | + new OA\Property(property: 'wechat_user', type: 'string', nullable: true, description: 'WeChat username'), |
| 36 | + new OA\Property(property: 'twitter_name', type: 'string', nullable: true, description: 'Twitter handle'), |
| 37 | + new OA\Property(property: 'language', type: 'string', nullable: true, description: 'Preferred language'), |
| 38 | + new OA\Property(property: 'birthday', type: 'integer', nullable: true, description: 'Date of birth (epoch)'), |
| 39 | + new OA\Property(property: 'phone_number', type: 'string', nullable: true, description: 'Phone number'), |
| 40 | + new OA\Property(property: 'company', type: 'string', nullable: true, description: 'Company name'), |
| 41 | + new OA\Property(property: 'job_title', type: 'string', nullable: true, description: 'Job title'), |
| 42 | + new OA\Property(property: 'spam_type', type: 'string', description: 'Spam classification', enum: ['None', 'Spam', 'Ham']), |
| 43 | + new OA\Property(property: 'last_login_date', type: 'integer', nullable: true, description: 'Last login date (epoch)'), |
| 44 | + new OA\Property(property: 'active', type: 'boolean', description: 'Whether the user account is active'), |
| 45 | + new OA\Property(property: 'public_profile_show_photo', type: 'boolean', description: 'Show photo in public profile'), |
| 46 | + new OA\Property(property: 'public_profile_show_fullname', type: 'boolean', description: 'Show full name in public profile'), |
| 47 | + new OA\Property(property: 'public_profile_show_email', type: 'boolean', description: 'Show email in public profile'), |
| 48 | + new OA\Property(property: 'public_profile_show_social_media_info', type: 'boolean', description: 'Show social media info in public profile'), |
| 49 | + new OA\Property(property: 'public_profile_show_bio', type: 'boolean', description: 'Show bio in public profile'), |
| 50 | + new OA\Property(property: 'public_profile_allow_chat_with_me', type: 'boolean', description: 'Allow chat in public profile'), |
| 51 | + new OA\Property(property: 'public_profile_show_telephone_number', type: 'boolean', description: 'Show telephone in public profile'), |
| 52 | + new OA\Property( |
| 53 | + property: 'groups', |
| 54 | + type: 'array', |
| 55 | + items: new OA\Items(oneOf: [ |
| 56 | + new OA\Schema(type: 'string', description: 'Group slug (when not expanded)'), |
| 57 | + new OA\Schema(ref: '#/components/schemas/Group', description:'Group object (when expanded)'), |
| 58 | + ]), |
| 59 | + description: 'User groups (expandable with expand=groups)' |
| 60 | + ), |
| 61 | + ] |
| 62 | + ) |
| 63 | + ] |
| 64 | +)] |
| 65 | +class UserSchema |
| 66 | +{ |
| 67 | +} |
0 commit comments