rdv: add API entry point for POSTing calendar range

This commit is contained in:
nobohan
2021-08-30 11:02:53 +02:00
parent ee4d23ff82
commit 329d3cc3d8
4 changed files with 66 additions and 12 deletions

View File

@@ -8,6 +8,28 @@ servers:
- url: "/api"
description: "Your current dev server"
components:
schemas:
Date:
type: object
properties:
datetime:
type: string
format: date-time
User:
type: object
properties:
id:
type: integer
type:
type: string
enum:
- user
username:
type: string
text:
type: string
paths:
/1.0/calendar/calendar.json:
get:
@@ -48,6 +70,34 @@ paths:
responses:
200:
description: "ok"
post:
tags:
- calendar
summary: create a new calendar range
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
user:
$ref: '#/components/schemas/User'
startDate:
$ref: '#/components/schemas/Date'
endDate:
$ref: '#/components/schemas/Date'
responses:
401:
description: "Unauthorized"
404:
description: "Not found"
200:
description: "OK"
422:
description: "Unprocessable entity (validation errors)"
400:
description: "transition cannot be applyed"
/1.0/calendar/calendar-range/{id}.json:
get: