Skip to content

Commit

Permalink
Create example.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
DorelBesliu authored Jul 8, 2020
0 parents commit 8a8ab87
Showing 1 changed file with 160 additions and 0 deletions.
160 changes: 160 additions & 0 deletions example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
openapi: 3.0.0
info:
title: App API
version: 1.0.0
servers:
- url: 'http://app-api.local/api'
description: Development Server
paths:
/student/events:
post:
tags:
- Student
summary: Create event
operationId: 'App\Http\Controllers\Student\EventsController::store'
requestBody:
content:
application/json:
schema:
properties:
teacher_id:
description: Teacher id
type: integer
start:
description: Start event time
type: string
format: date
lesson_duration:
description: Lesson duration in minutes
type: integer
format: date
lessons_amount:
description: Amount of lessons
type: integer
format: date
type:
description: Store a newly created resource in storage.
type: string
enum:
- EVENT_TYPE_OFFTIME
type: object
responses:
'200':
description: Event created succesfully
content:
application/json:
schema:
$ref: '#/components/schemas/EventResource'
'401':
description: Unauthorized
'500':
description: Sever error
security:
- auth:
- '*'
'/student/events/{event}':
put:
tags:
- Student
summary: Get event information
operationId: 'App\Http\Controllers\Student\EventsController::update'
parameters:
- name: event
in: path
description: Event id
required: true
schema:
type: integer
requestBody:
content:
application/json:
schema:
properties:
teacher_id:
description: Teacher id
type: integer
start:
description: Start event time
type: string
format: date
lesson_duration:
description: Lesson duration in minutes
type: integer
format: date
lessons_amount:
description: Amount of lessons
type: integer
format: date
type:
description: Update the specified resource in storage.
type: string
enum:
- EVENT_TYPE_OFFTIME
type: object
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/EventResource'
'401':
description: Unauthorized
'404':
description: Not found
'500':
description: Sever error
security:
- auth:
- '*'
components:
schemas:
EventResource:
title: Event
properties:
id:
description: Event id
type: integer
format: int64
teacherId:
description: Teacher id
type: integer
format: int64
studentId:
description: Student id
type: integer
format: int64
eventTipropertytle:
description: Event title
type: string
eventText:
description: Event notices
type: string
start:
description: Event start
type: string
format: date
lessonDuration:
description: Lesson duration
type: integer
format: int32
lessonsAmount:
description: Lesson amount
type: integer
format: int32
eventType:
description: Event type
type: string
type: object
xml:
name: Event
securitySchemes:
auth:
type: oauth2
flows:
password:
tokenUrl: 'http://student-app-api.local/api/login'
scopes: {}
tags:
- name: Student
description: ''

0 comments on commit 8a8ab87

Please sign in to comment.