#%RAML 1.0
---
baseUri: 'http://api.phpsx.org'
version: v1
title: PSX
/foo/{name}/{type}:
  description: 'lorem ipsum'
  uriParameters:
    name:
      description: 'Name parameter'
      type: string
      minLength: 0
      maxLength: 16
      pattern: '[A-z]+'
      required: true
    type:
      type: string
      enum: [foo, bar]
      required: false
  get:
    description: 'Returns a collection'
    queryParameters:
      startIndex:
        description: 'startIndex parameter'
        type: integer
        minimum: 0
        maximum: 32
        required: true
      float:
        type: number
        required: false
      boolean:
        type: boolean
        required: false
      date:
        type: date-only
        required: false
      datetime:
        type: datetime-only
        required: false
    responses:
      200:
        body:
          application/json:
            type: EntryCollection
  post:
    body:
      application/json:
        type: 1
    responses:
      201:
        body:
          application/json:
            type: EntryMessage
  put:
    body:
      application/json:
        type: 1
    responses:
      200:
        body:
          application/json:
            type: EntryMessage
  delete:
    body:
      application/json:
        type: 1
    responses:
      200:
        body:
          application/json:
            type: EntryMessage
  patch:
    body:
      application/json:
        type: 1
    responses:
      200:
        body:
          application/json:
            type: EntryMessage
types:
  Entry: { type: object, properties: { id: { type: integer }, userId: { type: integer }, title: { type: string, pattern: '[A-z]+', minLength: 3, maxLength: 16 }, date: { format: date-time, type: string } } }
  EntryCollection: { type: object, properties: { entry: { type: array, items: { $ref: '#/types/Entry' } } } }
  EntryCreate: { type: object, properties: { id: { type: integer }, userId: { type: integer }, title: { type: string, pattern: '[A-z]+', minLength: 3, maxLength: 16 }, date: { format: date-time, type: string } }, required: [title, date] }
  EntryDelete: { type: object, properties: { id: { type: integer }, userId: { type: integer }, title: { type: string, pattern: '[A-z]+', minLength: 3, maxLength: 16 }, date: { format: date-time, type: string } }, required: [id] }
  EntryMessage: { type: object, properties: { success: { type: boolean }, message: { type: string } } }
  EntryPatch: { type: object, properties: { id: { type: integer }, userId: { type: integer }, title: { type: string, pattern: '[A-z]+', minLength: 3, maxLength: 16 }, date: { format: date-time, type: string } }, required: [id] }
  EntryUpdate: { type: object, properties: { id: { type: integer }, userId: { type: integer }, title: { type: string, pattern: '[A-z]+', minLength: 3, maxLength: 16 }, date: { format: date-time, type: string } }, required: [id] }
  GetQuery: { type: object, properties: { startIndex: { description: 'startIndex parameter', type: integer, minimum: 0, maximum: 32 }, float: { type: number }, boolean: { type: boolean }, date: { format: date, type: string }, datetime: { format: date-time, type: string } }, required: [startIndex] }
  Path: { type: object, properties: { name: { description: 'Name parameter', type: string, pattern: '[A-z]+', minLength: 0, maxLength: 16 }, type: { enum: [foo, bar], type: string } }, required: [name] }
