RAML: fix description and pattern for username

#%RAML 0.8
title: CTU Sirius API
version: v1
baseUri: https://sirius.fit.cvut.cz/api/{version}
securedBy: [access_token]
securitySchemes:
  - access_token:
      description: |
        All Sirius read-only resources are secured by an access token. The token is either
        associated with an username (personal) or is set as global. This authorization
        scheme uses the same query parameter as OAuth 2.0, and will be later
        replaced by OAuth 2.0.
      type: x-access-token
      describedBy:
        queryParameters:
          access_token:
            description: |
              Used to send a valid access token.
            type: string
        responses:
          401:
            description: |
              Missing or invalid token. Authorization token was not specified or is not valid.
traits:
  - paged:
      usage: Retreive further pages in collection
      description: Use `offset` and `limit` to paginate the records.
      queryParameters:
        limit:
          description: The number of entries in collection to return
          type: number
          default: 10
          maximum: 100
        offset:
          description: Offset of the first entry in collection
          type: number
          default: 0
  - dateScoped:
      queryParameters:
        from:
          description: Return events from this date
          type: date
        to:
          description: Return events up to this date
          type: date
  - filterable:
      queryParameters:
        event_type:
          description: Filter by event's type
          type: string
          enum: [ exam, laboratory, lecture, tutorial ]
  - includable:
      queryParameters:
        include:
          description: Include linked resources per JSON API
          type: string
          example: people
  - secured:
      description: Marks resource as secured. You need to be authenticated and authorized to access it.
      queryParameters:
        access_token:
          description: Authentication and authorization is required. You need to set your `access_token` in URL.
          type: string
          example: 07a855e0-6920-11e4-a40a-0002a5d5c51b
          required: true
resourceTypes:
  - events-collection:
      get:
        is: [ paged, dateScoped, secured, filterable ]
        responses:
          200:
            body:
              application/json:
                example: |
                    {
                      "meta": {
                        "count": 2,
                        "offset": 0,
                        "limit": 20
                      },
                      "events": [
                        {
                          "id": 42,
                          "name": null,
                          "sequence_number": 12,
                          "starts_at": "2014-04-23T07:30:00.000+02:00",
                          "ends_at": "2014-04-23T11:00:00.000+02:00",
                          "deleted" : false,
                          "capacity": 24,
                          "event_type": "tutorial",
                          "parallel": "106",
                          "links": {
                            "room": "T9:350",
                            "course": "MI-RUB",
                            "teachers": [
                              "skocdopet"
                            ],
                            "students": [
                              "szolatib",
                              "vomackar"
                            ]
                          }
                        },
                        {
                          "id": 43,
                          "name": null,
                          "sequence_number": 12,
                          "starts_at": "2014-04-24T09:15:00.000+02:00",
                          "ends_at": "2014-04-24T10:45:00.000+02:00",
                          "deleted" : false,
                          "capacity": 196,
                          "event_type": "lecture",
                          "parallel": "1",
                          "links": {
                            "room": "T9:155",
                            "course": "MI-W20",
                            "teachers": [
                              "kuchajar",
                              "vitvatom"
                            ],
                            "students": [
                              "jirutjak"
                            ]
                          }
                        }
                      ]
                    }
              text/calendar:
                example: |
                  BEGIN:VCALENDAR
                  VERSION:2.0
                  CALSCALE:GREGORIAN
                  BEGIN:VEVENT
                  DTSTAMP:20140702T140133Z
                  UID:https://sirius.fit.cvut.cz/events/123
                  DTSTART:20140312T101500
                  DTEND:20140312T114500
                  CLASS:PUBLIC
                  CREATED:20140410T182546
                  LAST-MODIFIED:20140410T182546
                  LOCATION:T9:130
                  SUMMARY:MI-PSL 2. cvičení
                  END:VEVENT
                  BEGIN:VEVENT
                  DTSTAMP:20140702T140133Z
                  UID:https://sirius.fit.cvut.cz/events/125
                  DTSTART:20140312T101500
                  DTEND:20140312T114500
                  CLASS:PUBLIC
                  CREATED:20140410T182546
                  LAST-MODIFIED:20140410T182546
                  LOCATION:T9:130
                  SUMMARY:MI-PSL 2. cvičení
                  END:VEVENT
                  END:VCALENDAR
          404:
            description: There are no events within the current scope
  - event:
      get:
        is: [ secured ]
        responses:
          200:
            body:
              application/json:
                example: |
                  {
                    "events": {
                      "id": 42,
                      "name": null,
                      "sequence_number": 12,
                      "starts_at": "2014-04-23T07:30:00.000+02:00",
                      "ends_at": "2014-04-23T11:00:00.000+02:00",
                      "deleted" : false,
                      "capacity": 24,
                      "event_type": "tutorial",
                      "parallel": "106",
                      "links": {
                        "room": "T9:350",
                        "course": "MI-RUB",
                        "teachers": [
                          "skocdopet"
                        ],
                        "students": [
                          "szolatib",
                          "vomackar"
                        ]
                      }
                    }
                  }
              text/calendar:
                example: |
                  BEGIN:VCALENDAR
                  VERSION:2.0
                  CALSCALE:GREGORIAN
                  BEGIN:VEVENT
                  DTSTAMP:20140702T140133Z
                  UID:https://sirius.fit.cvut.cz/events/123
                  DTSTART:20140312T101500
                  DTEND:20140312T114500
                  CLASS:PUBLIC
                  CREATED:20140410T182546
                  LAST-MODIFIED:20140410T182546
                  LOCATION:T9:130
                  SUMMARY:MI-PSL 2. cvičení
                  END:VEVENT
                  END:VCALENDAR
/events:
  type: events-collection
  get:
    description: "Get all events without any scope"
  /{eventId}:
    type: event
/people/{username}/events:
  type: events-collection
  description: Get a calendar for a person
  uriParameters:
    username:
      description: person's unique username
      required: true
      pattern: "[a-z0-9]{3,8}"
      example: vomackar
/rooms/{kosId}/events:
  type: events-collection
  description: Get a calendar for a room
  uriParameters:
    kosId:
      description: |
        Common room identification used by KOS, for details see [the documentation](https://rozvoj.fit.cvut.cz/Main/znaceni-mistnosti#HKOSEDzna10DenED-102).
      required: true
      pattern: "[A-Z0-9]{2}:([A-Z0-9]+-)?[a-z0-9]+"
      example: "TH:A-1333"
/courses/{courseCode}/events:
  type: events-collection
  description: Get events instances for a given course
  uriParameters:
    courseCode:
      description: |
        Course code, faculty specific.
      required: true
      example: BI-PA1
/exceptions:
  description: Manage calendar exceptions
  is: [ paged, secured ]
  get:
    responses:
      200:
        body:
          application/json:
            example: |
              {
                "exceptions": [
                  {
                    "id": 43,
                    "name": "statni svatek",
                    "action": "cancel",
                    "starts_at": "2014-04-23T15:00:00Z",
                    "ends_at": "2014-04-23T19:00:00Z",
                    "recurrence": "FREQ=YEARLY",
                    "links": {
                      "parallels": ["", ""],
                      "divisions": ["18001"],
                      "semester": "B142"
                    }
                  }
                ]
              }

#%RAML 0.8
title: CTU Sirius API
version: v1
baseUri: https://sirius.fit.cvut.cz/api/{version}
securedBy: [access_token]
securitySchemes:
  - access_token:
      description: |
        All Sirius read-only resources are secured by an access token. The token is either
        associated with an username (personal) or is set as global. This authorization
        scheme uses the same query parameter as OAuth 2.0, and will be later
        replaced by OAuth 2.0.
      type: x-access-token
      describedBy:
        queryParameters:
          access_token:
            description: |
              Used to send a valid access token.
            type: string
        responses:
          401:
            description: |
              Missing or invalid token. Authorization token was not specified or is not valid.
traits:
  - paged:
      usage: Retreive further pages in collection
      description: Use `offset` and `limit` to paginate the records.
      queryParameters:
        limit:
          description: The number of entries in collection to return
          type: number
          default: 10
          maximum: 100
        offset:
          description: Offset of the first entry in collection
          type: number
          default: 0
  - dateScoped:
      queryParameters:
        from:
          description: Return events from this date
          type: date
        to:
          description: Return events up to this date
          type: date
  - filterable:
      queryParameters:
        event_type:
          description: Filter by event's type
          type: string
          enum: [ exam, laboratory, lecture, tutorial ]
  - includable:
      queryParameters:
        include:
          description: Include linked resources per JSON API
          type: string
          example: people
  - secured:
      description: Marks resource as secured. You need to be authenticated and authorized to access it.
      queryParameters:
        access_token:
          description: Authentication and authorization is required. You need to set your `access_token` in URL.
          type: string
          example: 07a855e0-6920-11e4-a40a-0002a5d5c51b
          required: true
resourceTypes:
  - events-collection:
      get:
        is: [ paged, dateScoped, secured, filterable ]
        responses:
          200:
            body:
              application/json:
                example: |
                    {
                      "meta": {
                        "count": 2,
                        "offset": 0,
                        "limit": 20
                      },
                      "events": [
                        {
                          "id": 42,
                          "name": null,
                          "sequence_number": 12,
                          "starts_at": "2014-04-23T07:30:00.000+02:00",
                          "ends_at": "2014-04-23T11:00:00.000+02:00",
                          "deleted" : false,
                          "capacity": 24,
                          "event_type": "tutorial",
                          "parallel": "106",
                          "links": {
                            "room": "T9:350",
                            "course": "MI-RUB",
                            "teachers": [
                              "skocdopet"
                            ],
                            "students": [
                              "szolatib",
                              "vomackar"
                            ]
                          }
                        },
                        {
                          "id": 43,
                          "name": null,
                          "sequence_number": 12,
                          "starts_at": "2014-04-24T09:15:00.000+02:00",
                          "ends_at": "2014-04-24T10:45:00.000+02:00",
                          "deleted" : false,
                          "capacity": 196,
                          "event_type": "lecture",
                          "parallel": "1",
                          "links": {
                            "room": "T9:155",
                            "course": "MI-W20",
                            "teachers": [
                              "kuchajar",
                              "vitvatom"
                            ],
                            "students": [
                              "jirutjak"
                            ]
                          }
                        }
                      ]
                    }
              text/calendar:
                example: |
                  BEGIN:VCALENDAR
                  VERSION:2.0
                  CALSCALE:GREGORIAN
                  BEGIN:VEVENT
                  DTSTAMP:20140702T140133Z
                  UID:https://sirius.fit.cvut.cz/events/123
                  DTSTART:20140312T101500
                  DTEND:20140312T114500
                  CLASS:PUBLIC
                  CREATED:20140410T182546
                  LAST-MODIFIED:20140410T182546
                  LOCATION:T9:130
                  SUMMARY:MI-PSL 2. cvičení
                  END:VEVENT
                  BEGIN:VEVENT
                  DTSTAMP:20140702T140133Z
                  UID:https://sirius.fit.cvut.cz/events/125
                  DTSTART:20140312T101500
                  DTEND:20140312T114500
                  CLASS:PUBLIC
                  CREATED:20140410T182546
                  LAST-MODIFIED:20140410T182546
                  LOCATION:T9:130
                  SUMMARY:MI-PSL 2. cvičení
                  END:VEVENT
                  END:VCALENDAR
          404:
            description: There are no events within the current scope
  - event:
      get:
        is: [ secured ]
        responses:
          200:
            body:
              application/json:
                example: |
                  {
                    "events": {
                      "id": 42,
                      "name": null,
                      "sequence_number": 12,
                      "starts_at": "2014-04-23T07:30:00.000+02:00",
                      "ends_at": "2014-04-23T11:00:00.000+02:00",
                      "deleted" : false,
                      "capacity": 24,
                      "event_type": "tutorial",
                      "parallel": "106",
                      "links": {
                        "room": "T9:350",
                        "course": "MI-RUB",
                        "teachers": [
                          "skocdopet"
                        ],
                        "students": [
                          "szolatib",
                          "vomackar"
                        ]
                      }
                    }
                  }
              text/calendar:
                example: |
                  BEGIN:VCALENDAR
                  VERSION:2.0
                  CALSCALE:GREGORIAN
                  BEGIN:VEVENT
                  DTSTAMP:20140702T140133Z
                  UID:https://sirius.fit.cvut.cz/events/123
                  DTSTART:20140312T101500
                  DTEND:20140312T114500
                  CLASS:PUBLIC
                  CREATED:20140410T182546
                  LAST-MODIFIED:20140410T182546
                  LOCATION:T9:130
                  SUMMARY:MI-PSL 2. cvičení
                  END:VEVENT
                  END:VCALENDAR
/events:
  type: events-collection
  get:
    description: "Get all events without any scope"
  /{eventId}:
    type: event
/people/{username}/events:
  type: events-collection
  description: Get a calendar for a person
  uriParameters:
    username:
      description: 8-char unique username
      required: true
      pattern: "[a-z0-9]{8}"
      example: vomackar
/rooms/{kosId}/events:
  type: events-collection
  description: Get a calendar for a room
  uriParameters:
    kosId:
      description: |
        Common room identification used by KOS, for details see [the documentation](https://rozvoj.fit.cvut.cz/Main/znaceni-mistnosti#HKOSEDzna10DenED-102).
      required: true
      pattern: "[A-Z0-9]{2}:([A-Z0-9]+-)?[a-z0-9]+"
      example: "TH:A-1333"
/courses/{courseCode}/events:
  type: events-collection
  description: Get events instances for a given course
  uriParameters:
    courseCode:
      description: |
        Course code, faculty specific.
      required: true
      example: BI-PA1
/exceptions:
  description: Manage calendar exceptions
  is: [ paged, secured ]
  get:
    responses:
      200:
        body:
          application/json:
            example: |
              {
                "exceptions": [
                  {
                    "id": 43,
                    "name": "statni svatek",
                    "action": "cancel",
                    "starts_at": "2014-04-23T15:00:00Z",
                    "ends_at": "2014-04-23T19:00:00Z",
                    "recurrence": "FREQ=YEARLY",
                    "links": {
                      "parallels": ["", ""],
                      "divisions": ["18001"],
                      "semester": "B142"
                    }
                  }
                ]
              }


Move cityId from parameters to base URI

Move cityId from parameters to base URI

#%RAML 0.8

title: Weather app API
baseUri: http://localhost/api/{version}/{cityId}
version: v0

/weather:
	description: |
		Возвращает информацию о погоде.
	get:
		responses:
			200:
				body:
					application/json:
						schema: |
							{
								"$schema": "http://json-schema.org/schema",
								"type": "object",
								"properties": {
									"temperature": {
										"type": "number",
									},
									"temperatureFeelsLike": {
										"type": "number",
									},
									"windVelocity": {
										"type": "number"
									},
									"windDirection": {
										"type": "string",
										"pattern": "^(S{1,2}|N{1,2})(E{1,2}|W{1,2})$"
									},
									"weatherThumbnailURL": {
										"type": "string"
									},
									"weatherInWords": {
										"type": "string"
									},
									"clothes": {
										"type": "array",
										"items": {
											"type": "object",
											"properties": {
												"name": {
													"type": "string"
												},
												"depth": {
													"type": "number"
												},
												"imgURL": {
													"type": "string"
												}
											}
										},
										"required": ["name", "depth", "imgURL"]
									}
								},
								"required": ["temperature","temperatureFeelsLike","windVelocity","windDirection", "weatherThumbnailURL", "weatherInWords", "clothes"]
							}
			404:

/cloth:
	/item/{item_id}:
		get:
			description: |
				Возвращает информацию о предмете гардероба.
			responses:
				200:
					body:
						application/json:
							schema: |
								{
									"$schema": "http://json-schema.org/schema",
									"type": "object",
									"description": "Описание предмета гардероба."
									"properties": {
										"name": {
											"type": "string",
											"description": "Название"
										},
										"description": {
											"type": "string",
											"description": "Текст - описание"
										},
										"group": {
											"type": "string",
											"description": "Группа. Определяет, где рисовать картинку."
										},
										"img": {
											"type": "string",
											"description": "URL файла картинки."
										}
									},
									required: ["name","description","group","layer"]
								}
				404:
	/choose:
		get:
			description: |
				Выбирает набор предметов одежды к заданным погодным условиям.
			queryParameters:
				season:
					enum: ["winter","spring","summer","autumn"]
					required: false
					description: |
						Время года (пока не обязательно).
				temperature:
					type: number
					required: true
					description: |
						Температура.
				windVelocity:
					type: number
					required: false
					description: |
						Скорость ветра (пока не обязательно).
			responses:
				200:
					body:
						application/json:
							schema: |
								{
									"$schema": "http://json-schema.org/schema",
									"type": "array",
									"items": {
										"type": "integer"
									}
								}

#%RAML 0.8

title: Weather app API
baseUri: http://localhost/api/{version}
version: v0

/weather:
	description: |
		Возвращает информацию о погоде.
	queryParameters:
		city_id:
			type: integer
			required: true
			description: |
				Id города, погодные условия которого запрошены.
	get:
		responses:
			200:
				body:
					application/json:
						schema: |
							{
								"$schema": "http://json-schema.org/schema",
								"type": "object",
								"properties": {
									"temperature": {
										"type": "number",
									},
									"temperatureFeelsLike": {
										"type": "number",
									},
									"windVelocity": {
										"type": "number"
									},
									"windDirection": {
										"type": "string",
										"pattern": "^(S{1,2}|N{1,2})(E{1,2}|W{1,2})$"
									},
									"weatherThumbnailURL": {
										"type": "string"
									},
									"weatherInWords": {
										"type": "string"
									},
									"clothes": {
										"type": "array",
										"items": {
											"type": "object",
											"properties": {
												"name": {
													"type": "string"
												},
												"depth": {
													"type": "number"
												},
												"imgURL": {
													"type": "string"
												}
											}
										},
										"required": ["name", "depth", "imgURL"]
									}
								},
								"required": ["temperature","temperatureFeelsLike","windVelocity","windDirection", "weatherThumbnailURL", "weatherInWords", "clothes"]
							}
			404:

/cloth:
	/item/{item_id}:
		get:
			description: |
				Возвращает информацию о предмете гардероба.
			responses:
				200:
					body:
						application/json:
							schema: |
								{
									"$schema": "http://json-schema.org/schema",
									"type": "object",
									"description": "Описание предмета гардероба."
									"properties": {
										"name": {
											"type": "string",
											"description": "Название"
										},
										"description": {
											"type": "string",
											"description": "Текст - описание"
										},
										"group": {
											"type": "string",
											"description": "Группа. Определяет, где рисовать картинку."
										},
										"img": {
											"type": "string",
											"description": "URL файла картинки."
										}
									},
									required: ["name","description","group","layer"]
								}
				404:
	/choose:
		get:
			description: |
				Выбирает набор предметов одежды к заданным погодным условиям.
			queryParameters:
				season:
					enum: ["winter","spring","summer","autumn"]
					required: false
					description: |
						Время года (пока не обязательно).
				temperature:
					type: number
					required: true
					description: |
						Температура.
				windVelocity:
					type: number
					required: false
					description: |
						Скорость ветра (пока не обязательно).
			responses:
				200:
					body:
						application/json:
							schema: |
								{
									"$schema": "http://json-schema.org/schema",
									"type": "array",
									"items": {
										"type": "integer"
									}
								}