mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
OpenAPI
This commit is contained in:
parent
daa402c778
commit
ac96a01c03
@ -138,7 +138,16 @@ class LoginController extends BaseController
|
||||
* @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"),
|
||||
* @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"),
|
||||
* @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"),
|
||||
* @OA\JsonContent(ref="#/components/schemas/Company"),
|
||||
* @OA\JsonContent(ref="#/components/schemas/CompanyUser"),
|
||||
|
||||
* ),
|
||||
* @OA\Response(
|
||||
* response=422,
|
||||
* description="Validation error",
|
||||
* @OA\Header(header="X-API-TOKEN", ref="#/components/headers/X-API-TOKEN"),
|
||||
* @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"),
|
||||
* @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"),
|
||||
* @OA\JsonContent(ref="#/components/schemas/ValidationError"),
|
||||
|
||||
* ),
|
||||
* @OA\Response(
|
||||
|
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* @OA\Schema(
|
||||
* schema="Company",
|
||||
* type="object"
|
||||
* type="object",
|
||||
* @OA\Property(property="id", type="string", example="WJxbojagwO", description="The company hash id"),
|
||||
* @OA\Property(property="name", type="string", example="The local shop", description="The company name"),
|
||||
* @OA\Property(property="logo", type="object", example="logo.png", description="The company logo - binary"),
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
/**
|
||||
* @OA\Schema(
|
||||
* schema="CompanyUser",
|
||||
@ -8,13 +8,13 @@
|
||||
* @OA\Property(property="settings", type="object", example="The local shop", description="The company name"),
|
||||
* @OA\Property(property="is_owner", type="boolean", example=true, description="Determines whether the user owns this company"),
|
||||
* @OA\Property(property="is_locked", type="boolean", example=true, description="Determines whether the users access to this company has been locked"),
|
||||
* @OA\Property(property="updated_at", type="int", example="1231232312321", description="The last time the record was modified"),
|
||||
* @OA\Property(property="deleted_at", type="int", example="12312312321", description="Timestamp when the user was archived"),
|
||||
* @OA\Property(property="updated_at", type="integer", example="1231232312321", description="The last time the record was modified"),
|
||||
* @OA\Property(property="deleted_at", type="integer", example="12312312321", description="Timestamp when the user was archived"),
|
||||
* ),
|
||||
* @OA\Schema(ref="#/components/schema/Company"),
|
||||
* @OA\Schema(ref="#/components/schema/User"),
|
||||
* @OA\Schema(ref="#/components/schema/Account"),
|
||||
* @OA\Schema(ref="#/components/schema/CompanyToken"),
|
||||
* @OA\Schema(ref="#/components/schemas/Company"),
|
||||
* @OA\Schema(ref="#/components/schemas/User"),
|
||||
* @OA\Schema(ref="#/components/schemas/Account"),
|
||||
* @OA\Schema(ref="#/components/schemas/CompanyToken"),
|
||||
* }
|
||||
* )
|
||||
*/
|
||||
|
@ -4,6 +4,6 @@
|
||||
* schema="Error",
|
||||
* type="object",
|
||||
* @OA\Property(property="message", type="string", example="Unexpected error", description="The company name"),
|
||||
* @OA\Property(property="code", type="int32", example="500", description="The HTTP error code"),
|
||||
* @OA\Property(property="code", type="integer", example="500", description="The HTTP error code"),
|
||||
* )
|
||||
*/
|
||||
|
@ -1 +1,17 @@
|
||||
<?php
|
||||
<?php
|
||||
/**
|
||||
* @OA\Schema(
|
||||
* schema="User",
|
||||
* type="object",
|
||||
* @OA\Property(property="id", type="string", example="Opnel5aKBz", description="__________"),
|
||||
* @OA\Property(property="first_name", type="string", example="The users first name", description="________"),
|
||||
* @OA\Property(property="last_name", type="string", example="The users last name", description="_________"),
|
||||
* @OA\Property(property="email", type="string", example="", description="_________"),
|
||||
* @OA\Property(property="phone", type="string", example="555-1233-23232", description="_________"),
|
||||
* @OA\Property(property="signature", type="string", example="A users text signature", description="_________"),
|
||||
* @OA\Property(property="avatar", type="string", example="https://url.to.your/avatar.png", description="_________"),
|
||||
* @OA\Property(property="accepted_terms_version", type="string", example="1.0.1", description="_________"),
|
||||
* @OA\Property(property="oauth_user_id", type="string", example="jkhasdf789as6f675sdf768sdfs", description="_________"),
|
||||
* @OA\Property(property="oauth_provider_id", type="string", example="google", description="_________"),
|
||||
* )
|
||||
*/
|
20
app/Http/Controllers/OpenAPI/ValidationErrorSchema.php
Normal file
20
app/Http/Controllers/OpenAPI/ValidationErrorSchema.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* @OA\Schema(
|
||||
* schema="ValidationError",
|
||||
* type="object",
|
||||
* @OA\Property(property="message", type="string", example="The given data was invalid.", description="The error message"),
|
||||
* @OA\Property(
|
||||
* property="errors",
|
||||
* type="object",
|
||||
* @OA\Property(
|
||||
* property="value",
|
||||
* type="array",
|
||||
* @OA\Items(
|
||||
* type="string",
|
||||
* ),
|
||||
*
|
||||
* ),
|
||||
* ),
|
||||
* )
|
||||
*/
|
Loading…
x
Reference in New Issue
Block a user