From patchwork Tue Oct 30 11:19:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 990735 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42kpy317l9z9s7W for ; Tue, 30 Oct 2018 22:23:55 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="GG7svkzY"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42kpy25NyLzF0yr for ; Tue, 30 Oct 2018 22:23:54 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="GG7svkzY"; dkim-atps=neutral X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=that.guru (client-ip=185.234.75.13; helo=relay013.mxrelay.co; envelope-from=stephen@that.guru; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="GG7svkzY"; dkim-atps=neutral Received: from relay013.mxrelay.co (relay013.mxrelay.co [185.234.75.13]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42kpsX6WjYzDrSM for ; Tue, 30 Oct 2018 22:20:00 +1100 (AEDT) Received: from filter002.mxroute.com (unknown [185.133.192.179]) by relay013.mxrelay.co (Postfix) with ESMTP id 537B642DDA for ; Tue, 30 Oct 2018 11:19:28 +0000 (UTC) Received: from one.mxroute.com (one.mxroute.com [195.201.59.211]) by filter002.mxroute.com (Postfix) with ESMTPS id 2E17D3F546 for ; Tue, 30 Oct 2018 11:19:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=uH0QTmfGU9w7El38Fw1c8dshxDJ5JIGA6BkHjMtH01E=; b=GG7svkzYxhKG0parRAa5EUIiSX Iel3/xa+WLpmNyQ/jb7dDg3KUekRNTJ23ji/1UfIOkGOeqgA3+8qMX1/reZAqbNzqWvMI8se0fC9c LhuLcxNVk0fBG6hij1m4l3xkW7EOiFBDkqQR5ZlybysQNP7H8eBhzotk7/+UJmk64XbGoWwV8u3yV sN8mcIJm8hHK3dd7DOGOsLdRht6iwsljaHVaAjmHxJfGjnQGeXGOnYSbPYNKO4GRF0M4FkHEJDEI9 hJwUblauN/REEG8aP8jBEATYqLgKnqyYkLPGyx7HPK0elJeqetjWBCkyf+zrMfyd2tw3Oa7qLBpwL /Az0TV+Q==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 08/17] docs: Document the '/projects' resource Date: Tue, 30 Oct 2018 11:19:07 +0000 Message-Id: <20181030111916.7342-9-stephen@that.guru> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181030111916.7342-1-stephen@that.guru> References: <20181030111916.7342-1-stephen@that.guru> X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" This one's pretty straightforward. Signed-off-by: Stephen Finucane --- docs/api/schemas/patchwork.yaml | 223 ++++++++++++++++++++++++++++++++ 1 file changed, 223 insertions(+) diff --git a/docs/api/schemas/patchwork.yaml b/docs/api/schemas/patchwork.yaml index f713f850..99a15ad4 100644 --- a/docs/api/schemas/patchwork.yaml +++ b/docs/api/schemas/patchwork.yaml @@ -75,6 +75,144 @@ paths: $ref: '#/components/schemas/Error' tags: - people + /api/projects/: + get: + description: List projects. + operationId: projects_list + parameters: + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/Order' + - $ref: '#/components/parameters/Search' + responses: + '200': + description: '' + headers: + Link: + $ref: '#/components/headers/Link' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Project' + tags: + - projects + /api/projects/{id}/: + get: + description: Show a project. + operationId: projects_read + parameters: + - in: path + name: id + required: true + schema: + description: '' + title: '' + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Project' + '400': + description: 'Bad request' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorProjectUpdate' + '403': + description: 'Forbidden' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: 'Not found' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + tags: + - projects + patch: + description: Update a project (partial). + operationId: projects_partial_update + parameters: + - in: path + name: id + required: true + schema: + description: '' + title: '' + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Project' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Project' + '403': + description: 'Forbidden' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: 'Not found' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + tags: + - projects + put: + description: Update a project. + operationId: projects_update + parameters: + - in: path + name: id + required: true + schema: + description: '' + title: '' + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Project' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Project' + '403': + description: 'Forbidden' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: 'Not found' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + tags: + - projects /api/users/: get: description: List users. @@ -329,6 +467,73 @@ components: minLength: 1 user: $ref: '#/components/schemas/UserEmbedded' + Project: + type: object + properties: + id: + title: ID + type: integer + readOnly: true + url: + title: Url + type: string + format: uri + readOnly: true + name: + title: Name + type: string + readOnly: true + minLength: 1 + link_name: + title: Link name + type: string + readOnly: true + maxLength: 255 + minLength: 1 + list_id: + title: List id + type: string + readOnly: true + maxLength: 255 + minLength: 1 + list_email: + title: List email + type: string + format: email + readOnly: true + maxLength: 200 + minLength: 1 + web_url: + title: Web URL + type: string + format: uri + maxLength: 2000 + scm_url: + title: SCM URL + type: string + format: uri + maxLength: 2000 + webscm_url: + title: Web SCM URL + type: string + format: uri + maxLength: 2000 + maintainers: + type: array + items: + $ref: '#/components/schemas/UserEmbedded' + readOnly: true + uniqueItems: true + subject_match: + title: Subject match + description: Regex to match the subject against if only part of emails + sent to the list belongs to this project. Will be used with + IGNORECASE and MULTILINE flags. If rules for more projects match the + first one returned from DB is chosen; empty field serves as a + default for every email which has no other match. + type: string + readOnly: true + minLength: 1 User: type: object properties: @@ -402,6 +607,24 @@ components: title: Detail type: string readOnly: true + ErrorProjectUpdate: + type: object + properties: + web_url: + title: Web URL + type: string + format: uri + readOnly: true + scm_url: + title: SCM URL + type: string + format: uri + readOnly: true + webscm_url: + title: Web SCM URL + type: string + format: uri + readOnly: true ErrorUserUpdate: type: object properties: