swagger bugfix

This commit is contained in:
zgdxiaoxiao 2016-09-21 10:43:04 +08:00
parent 40858761d8
commit bfb5db7c97
6 changed files with 33 additions and 41 deletions

View File

@ -881,7 +881,7 @@ paths:
schema: schema:
type: array type: array
items: items:
$ref: '#/definitions/JobStatus' $ref: '#/definitions/RepPolicy'
headers: headers:
X-Total-Count: X-Total-Count:
description: The total count of jobs description: The total count of jobs
@ -1211,8 +1211,6 @@ paths:
200: 200:
description: Get replication's target successfully. description: Get replication's target successfully.
schema: schema:
type: array
items:
$ref: '#/definitions/RepTarget' $ref: '#/definitions/RepTarget'
401: 401:
description: User need to log in first. description: User need to log in first.
@ -1302,18 +1300,18 @@ definitions:
SearchRepository: SearchRepository:
type: object type: object
properties: properties:
repository_name:
type: string
description: The name of the repository
project_name:
type: string
description: The name of the project that the repository belongs to
project_id: project_id:
type: integer type: integer
description: The ID of the project that the repository belongs to description: The ID of the project that the repository belongs to
project_name:
type: string
description: The name of the project that the repository belongs to
project_public: project_public:
type: integer type: integer
description: The flag to indicate the publicity of the project that the repository belongs to (1 is public, 0 is not) description: The flag to indicate the publicity of the project that the repository belongs to (1 is public, 0 is not)
repository_name:
type: string
description: The name of the repository
ProjectReq: ProjectReq:
type: object type: object
properties: properties:
@ -1348,10 +1346,6 @@ definitions:
type: integer type: integer
format: int32 format: int32
description: A deletion mark of the project (1 means it's deleted, 0 is not) description: A deletion mark of the project (1 means it's deleted, 0 is not)
user_id:
type: integer
format: int32
description: A relation field to the user table.
owner_name: owner_name:
type: string type: string
description: The owner name of the project. description: The owner name of the project.
@ -1359,7 +1353,7 @@ definitions:
type: integer type: integer
format: int format: int
description: The public status of the project. description: The public status of the project.
togglable: Togglable:
type: boolean type: boolean
description: Correspond to the UI about whether the project's publicity is updatable (for UI) description: Correspond to the UI about whether the project's publicity is updatable (for UI)
current_user_role_id: current_user_role_id:
@ -1470,6 +1464,8 @@ definitions:
role_name: role_name:
type: string type: string
description: Name the the role. description: Name the the role.
role_mask:
type: string
RoleParam: RoleParam:
type: object type: object
properties: properties:
@ -1488,7 +1484,7 @@ definitions:
repo_name: repo_name:
type: string type: string
description: The name of the repo description: The name of the repo
access_count: count:
type: integer type: integer
format: int format: int
description: The access count of the repo description: The access count of the repo
@ -1574,9 +1570,6 @@ definitions:
type: integer type: integer
format: int64 format: int64
description: The target ID. description: The target ID.
target_name:
type: string
description: The target name.
name: name:
type: string type: string
description: The policy name. description: The policy name.
@ -1602,6 +1595,8 @@ definitions:
error_job_count: error_job_count:
format: int format: int
description: The error job count number for the policy. description: The error job count number for the policy.
deleted:
type: integer
RepPolicyPost: RepPolicyPost:
type: object type: object
properties: properties:
@ -1687,4 +1682,3 @@ definitions:
password: password:
type: string type: string
description: The target server password. description: The target server password.

View File

@ -42,9 +42,6 @@ type Project struct {
// A deletion mark of the project (1 means it's deleted, 0 is not) // A deletion mark of the project (1 means it's deleted, 0 is not)
Deleted int32 `json:"deleted,omitempty"` Deleted int32 `json:"deleted,omitempty"`
// A relation field to the user table.
UserId int32 `json:"user_id,omitempty"`
// The owner name of the project. // The owner name of the project.
OwnerName string `json:"owner_name,omitempty"` OwnerName string `json:"owner_name,omitempty"`
@ -52,7 +49,7 @@ type Project struct {
Public int32 `json:"public,omitempty"` Public int32 `json:"public,omitempty"`
// Correspond to the UI about whether the project's publicity is updatable (for UI) // Correspond to the UI about whether the project's publicity is updatable (for UI)
Togglable bool `json:"togglable,omitempty"` Togglable bool `json:"Togglable,omitempty"`
// The role ID of the current user who triggered the API (for UI) // The role ID of the current user who triggered the API (for UI)
CurrentUserRoleId int32 `json:"current_user_role_id,omitempty"` CurrentUserRoleId int32 `json:"current_user_role_id,omitempty"`

View File

@ -36,9 +36,6 @@ type RepPolicy struct {
// The target ID. // The target ID.
TargetId int64 `json:"target_id,omitempty"` TargetId int64 `json:"target_id,omitempty"`
// The target name.
TargetName string `json:"target_name,omitempty"`
// The policy name. // The policy name.
Name string `json:"name,omitempty"` Name string `json:"name,omitempty"`
@ -59,4 +56,6 @@ type RepPolicy struct {
// The update time of the policy. // The update time of the policy.
UpdateTime string `json:"update_time,omitempty"` UpdateTime string `json:"update_time,omitempty"`
Deleted int32 `json:"deleted,omitempty"`
} }

View File

@ -32,4 +32,6 @@ type Role struct {
// Name the the role. // Name the the role.
RoleName string `json:"role_name,omitempty"` RoleName string `json:"role_name,omitempty"`
RoleMask string `json:"role_mask,omitempty"`
} }

View File

@ -24,15 +24,15 @@ package apilib
type SearchRepository struct { type SearchRepository struct {
// The name of the repository // The ID of the project that the repository belongs to
RepositoryName string `json:"repository_name,omitempty"` ProjectId int32 `json:"project_id,omitempty"`
// The name of the project that the repository belongs to // The name of the project that the repository belongs to
ProjectName string `json:"project_name,omitempty"` ProjectName string `json:"project_name,omitempty"`
// The ID of the project that the repository belongs to
ProjectId int32 `json:"project_id,omitempty"`
// The flag to indicate the publicity of the project that the repository belongs to (1 is public, 0 is not) // The flag to indicate the publicity of the project that the repository belongs to (1 is public, 0 is not)
ProjectPublic int32 `json:"project_public,omitempty"` ProjectPublic int32 `json:"project_public,omitempty"`
// The name of the repository
RepositoryName string `json:"repository_name,omitempty"`
} }

View File

@ -28,5 +28,5 @@ type TopRepo struct {
RepoName string `json:"repo_name,omitempty"` RepoName string `json:"repo_name,omitempty"`
// The access count of the repo // The access count of the repo
AccessCount int32 `json:"access_count,omitempty"` Count int32 `json:"count,omitempty"`
} }