Skip to content

Commit

Permalink
Fix Swagger docs for create and update user endpoints and add Insomni…
Browse files Browse the repository at this point in the history
…a Collection
  • Loading branch information
WendellAdriel committed May 19, 2023
1 parent 0da3aa2 commit 381d66a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/Auth/DTOs/CreateUserDTO.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
new OA\Property(property: 'name', type: 'string'),
new OA\Property(property: 'email', type: 'string'),
new OA\Property(property: 'password', type: 'string'),
new OA\Property(property: 'password_confirmation', type: 'string'),
new OA\Property(property: 'role', type: 'string', default: 'regular', enum: ['viewer', 'regular', 'manager', 'admin']),
],
)]
Expand Down
1 change: 1 addition & 0 deletions modules/Auth/DTOs/UpdateUserDTO.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
new OA\Property(property: 'email', type: 'string'),
new OA\Property(property: 'current_password', type: 'string'),
new OA\Property(property: 'password', type: 'string'),
new OA\Property(property: 'password_confirmation', type: 'string'),
new OA\Property(property: 'role', type: 'string', default: 'regular', enum: ['viewer', 'regular', 'manager', 'admin']),
new OA\Property(property: 'active', type: 'boolean'),
],
Expand Down
4 changes: 4 additions & 0 deletions public/swagger/swagger/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ components:
type: string
password:
type: string
password_confirmation:
type: string
role:
type: string
default: regular
Expand Down Expand Up @@ -341,6 +343,8 @@ components:
type: string
password:
type: string
password_confirmation:
type: string
role:
type: string
default: regular
Expand Down
1 change: 1 addition & 0 deletions tools/ExA_Insomnia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"_type":"export","__export_format":4,"__export_date":"2023-05-19T09:48:15.276Z","__export_source":"insomnia.desktop.app:v2023.1.0","resources":[{"_id":"req_f538ba711c684602aaf931325b4e735b","parentId":"fld_13580750ddef49c481f636867d4ec9b7","modified":1684488643657,"created":1684488545696,"url":"{{api_url}}/sanctum/csrf-cookie","name":"CSRF Cookie","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1684488545696,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_13580750ddef49c481f636867d4ec9b7","parentId":"fld_e61e669879ae422bac765098b6ec6dc9","modified":1684488126628,"created":1684488126628,"name":"Auth","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1684488126628,"_type":"request_group"},{"_id":"fld_e61e669879ae422bac765098b6ec6dc9","parentId":"wrk_07405a9c62c846cab5d2b81bed13055a","modified":1684488116721,"created":1684488116721,"name":"Auth","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1684488116721,"_type":"request_group"},{"_id":"wrk_07405a9c62c846cab5d2b81bed13055a","parentId":null,"modified":1684487974728,"created":1684487974728,"name":"ExA","description":"","scope":"collection","_type":"workspace"},{"_id":"req_ba4f509dcdda4517a2a5192a3d84bb15","parentId":"fld_13580750ddef49c481f636867d4ec9b7","modified":1684488763499,"created":1684488151716,"url":"{{api_url}}/v1/auth/login","name":"Login","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"email\": \"{{email}}\",\n\t\"password\": \"{{password}}\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json","id":"pair_195618d92fc14f618f712b85e7d49a3b"}],"authentication":{},"metaSortKey":-1684488151716,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_74a14e2652ea450fabe7e6c55cfda8f9","parentId":"fld_13580750ddef49c481f636867d4ec9b7","modified":1684489217920,"created":1684488841055,"url":"{{api_url}}/v1/auth/logout","name":"Logout","description":"","method":"POST","body":{},"parameters":[],"headers":[],"authentication":{"type":"bearer","token":"{{auth_token}}"},"metaSortKey":-1684359043414.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_95fc835312c84aa6ad1f060d97fd95a1","parentId":"fld_13580750ddef49c481f636867d4ec9b7","modified":1684489268630,"created":1684489263047,"url":"{{api_url}}/v1/auth/me","name":"Logged User","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{"type":"bearer","token":"{{auth_token}}"},"metaSortKey":-1684294489263.75,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_ad600a226bcc468a9f15fa94e34abb06","parentId":"fld_a37a45da877447c0af7790f4b68ee8f6","modified":1684489309092,"created":1684489284510,"url":"{{api_url}}/v1/users","name":"Users List","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{"type":"bearer","token":"{{auth_token}}"},"metaSortKey":-1684489284510,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_a37a45da877447c0af7790f4b68ee8f6","parentId":"fld_e61e669879ae422bac765098b6ec6dc9","modified":1684488148978,"created":1684488134698,"name":"User","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1684488126578,"_type":"request_group"},{"_id":"req_9e94102f1c454c3896f74d7e387cc031","parentId":"fld_a37a45da877447c0af7790f4b68ee8f6","modified":1684489477595,"created":1684489344398,"url":"{{api_url}}/v1/users","name":"Create User","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"name\": \"Test\",\n\t\"email\": \"[email protected]\",\n\t\"password\": \"s3Cr3T!@\",\n\t\"password_confirmation\": \"s3Cr3T!@\",\n\t\"role\": \"regular\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{"type":"bearer","token":"{{auth_token}}"},"metaSortKey":-1684488915103,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_80cac5d6d33a4a5da4133f11427aa669","parentId":"fld_a37a45da877447c0af7790f4b68ee8f6","modified":1684489554164,"created":1684489539682,"url":"{{api_url}}/v1/users/edcf6c76-fe79-4e2c-993d-3539886d7613","name":"User Profile","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{"type":"bearer","token":"{{auth_token}}"},"metaSortKey":-1684488730399.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_13c28c93f11942c48be8304e36f830b5","parentId":"fld_a37a45da877447c0af7790f4b68ee8f6","modified":1684489613304,"created":1684489581852,"url":"{{api_url}}/v1/users/edcf6c76-fe79-4e2c-993d-3539886d7613","name":"Update User","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\"name\": \"Wendell\",\n\t\"email\": \"[email protected]\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{"type":"bearer","token":"{{auth_token}}"},"metaSortKey":-1684488730349.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_ad2144cefb2a4620b6ef27e76781eef0","parentId":"fld_a37a45da877447c0af7790f4b68ee8f6","modified":1684489652112,"created":1684489631139,"url":"{{api_url}}/v1/users/65b12840-d534-4361-9677-67a611c71bd4","name":"Delete User","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{"type":"bearer","token":"{{auth_token}}"},"metaSortKey":-1684488730299.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_ca791be5e797a91d09d589789610900df7674367","parentId":"wrk_07405a9c62c846cab5d2b81bed13055a","modified":1684488983199,"created":1684487974731,"name":"Base Environment","data":{"api_url":"http://localhost:8000","auth_token":"{% response 'body', 'req_ba4f509dcdda4517a2a5192a3d84bb15', 'b64::JC50b2tlbg==::46b', 'never', 60 %}","email":"[email protected]","password":"password"},"dataPropertyOrder":{"&":["api_url","auth_token","email","password"]},"color":null,"isPrivate":false,"metaSortKey":1684487974731,"_type":"environment"},{"_id":"jar_ca791be5e797a91d09d589789610900df7674367","parentId":"wrk_07405a9c62c846cab5d2b81bed13055a","modified":1684488634129,"created":1684487974732,"name":"Default Jar","cookies":[{"key":"XSRF-TOKEN","value":"eyJpdiI6Ilk5eE41RnluNVZBSlkwRVZYdGlXUGc9PSIsInZhbHVlIjoiVFpIWHBja0JpbXVFUDlkTEFoeEpaajBKR2lzVEs2elp2NXEzMEV6akZES2lXTUs4TFRaUGw2QlV1c0x4dHpCYmlLRDVXUkpPRk0rMEE1ZVF0OFg1cFlPZ3QrNko1VmozQkV5L29VTGJ6RHZtZ2l2N3ZzakRwMlgyYU1PYmJWS00iLCJtYWMiOiIwMzI1ZTVmZjBkZGZhZjgxYWJkZWUxYjlkNWVkMzdmNGQ5MGMyZTBkODMxMDYzZTRlMjJlZGIwYTIxMzIzMDEzIiwidGFnIjoiIn0%3D","expires":"2023-05-19T11:30:34.000Z","maxAge":7200,"domain":"localhost","path":"/","extensions":["samesite=lax"],"hostOnly":true,"creation":"2023-05-19T09:30:34.128Z","lastAccessed":"2023-05-19T09:30:34.128Z","id":"6876774413175781"},{"key":"exa_session","value":"eyJpdiI6ImtNT2lrc21obXNJKzJRbm4vTHhlM3c9PSIsInZhbHVlIjoiUjd1Z3ZtR0NhMGM1aHhZeVJraHdsV2ZIQ3FUdEZkUTJvd1RpY256SldvUWJZZWVJSHkyK1l5R1NqN09vL2VyWGFUKzF5bHpMUXQzVW5HdmZCVWRJYklZVEYyaC91OTF6ZkxQRG55WHkxYnpXdzN6RkpOd2xsN0NCQndvZnIvNzIiLCJtYWMiOiI2YTBmZTEyYWE0NDQ3MWYxYzdiMjhmY2M0MGZhM2E1OTQ4OGM5NmM4NmZmOWQ4NjRmZGYyZGFmNTRlYWUzNDg2IiwidGFnIjoiIn0%3D","expires":"2023-05-19T11:30:34.000Z","maxAge":7200,"domain":"localhost","path":"/","httpOnly":true,"extensions":["samesite=lax"],"hostOnly":true,"creation":"2023-05-19T09:30:34.129Z","lastAccessed":"2023-05-19T09:30:34.129Z","id":"9461328716861659"}],"_type":"cookie_jar"},{"_id":"spc_67c0cf4da2274d84a401415421a15003","parentId":"wrk_07405a9c62c846cab5d2b81bed13055a","modified":1684487974729,"created":1684487974729,"fileName":"ExA","contents":"","contentType":"yaml","_type":"api_spec"}]}

0 comments on commit 381d66a

Please sign in to comment.