swagger: '2.0'
info:
  version: 0.0.11
  title: Kartotherian
  description: Renders map tiles
  termsOfService: https://wikimediafoundation.org/wiki/Terms_of_Use
  contact:
    name: Yuri Astrakhan
    url: http://mediawiki.org/wiki/Maps
  license:
    name: Apache2
    url: http://www.apache.org/licenses/LICENSE-2.0

paths:
#  # Tiles handler
#  # /{src}/{z}/{x}/{y}.{format}:
#  /osm-intl/11/828/655.png:
#    get:
#      tags:
#        - kartotherian
#        - maps
#        - maptiles
#      description: Renders an image tile for the given source, zoom, and coordinates.
#      produces:
#        - image/png
#        - application/json
#        - application/x-protobuf
#      x-amples:
#        - title: get a tile in the middle of the ocean, with overzoom
#          response:
#            status: 200
#            headers:
#              content-type: image/png
#  # Tiles handler with scaling
#  # /{src}/{z}/{x}/{y}@{scale}x.{format}:
#  /osm-intl/9/207/163@1.5x.png:
#    get:
#      tags:
#        - kartotherian
#        - maps
#        - maptiles
#      description: Renders an image tile for the given source, zoom, and coordinates, with scaling.
#      produces:
#        - image/png
#        - application/json
#      x-amples:
#        - title: default scaled tile
#          response:
#            status: 200
#            headers:
#              content-type: image/png
  # Source info
  # /{src}/info.json:
  /osm-intl/info.json:
    get:
      tags:
        - tileinfo
      description: Returns json describing given tile source
      produces:
        - application/json
      x-amples:
        - title: tile service info for osm-intl
          response:
            status: 200
            headers:
              content-type: application/json
  # Private source info
  # /{src}/info.json:
  /private-info/info.json:
    get:
      tags:
        - tileinfo
      description: Returns error describing that given tile source is private
      produces:
        - application/json
      x-amples:
        - title: private tile service info for osm-intl
          response:
            status: 400
            headers:
              content-type: application/json
  # Maki icon markers (pushpins)
  # /v4/marker/{base}-{size}-{symbol}+{color}@{scale}x.png:
  /v4/marker/pin-m-fuel+ffffff@2x.png:
    get:
      tags:
        - marker
        - maki
      description: Renders 2x scaled pushpin marker of a given color and size with an icon.
      produces:
        - image/png
      x-amples:
        - title: scaled pushpin marker with an icon
          response:
            status: 200
            headers:
              content-type: image/png
  # /v4/marker/{base}-{size}-{symbol}+{color}.png:
  /v4/marker/pin-m-fuel+ffffff.png:
    get:
      description: Renders pushpin marker of a given color and size with an icon.
      produces:
        - image/png
  # /v4/marker/{base}-{size}+{color}.png:
  /v4/marker/pin-m+ffffff.png:
    get:
      description: Renders a pushpin marker of a given color and size withoun an icon
      produces:
        - image/png
  # /v4/marker/{base}-{size}+{color}@{scale}x.png:
  /v4/marker/pin-m+ffffff@2x.png:
    get:
      description: Renders 2x scaled pushpin marker of a given color and size withoun an icon.
      produces:
        - image/png
#  # Map snapshots
#  # /img/{src},{z},{lat},{lon},{w}x{h}@{scale}x.{format}:
#  /img/osm-intl,1,0.0,0.0,100x100@1.5x.png:
#    get:
#      tags:
#        - kartotherian
#        - maps
#        - maptiles
#      description: Renders requested map region as a scaled image (static map snapshot)
#      produces:
#        - image/png
#      x-amples:
#        - title: Small scaled map
#          response:
#            status: 200
#            headers:
#              content-type: image/png
  # /{src}/{z},{lat},{lon},{w}x{h}.{format}:
  /osm-intl/1,0.0,0.0,100x100.png:
    get:
      description: Renders requested map region as an image
      x-monitor: false
      produces:
        - image/png
  # geoline service
  # /geoline?getgeojson=1&ids={ids}:
  /geoline?getgeojson=1&ids=Q649:
    get:
      tags:
        - kartotherian
        - maps
        - geojson
      description: Returns a json representation of a given line
      x-monitor: false
      produces:
        - application/vnd.geo+json
      x-amples:
        - title: get Moscow geojson
          response:
            status: 200
            headers:
              content-type: application/vnd.geo+json; charset=utf-8
  # geoshape service
  # /geoshape?getgeojson=1&ids={ids}:
  /geoshape?getgeojson=1&ids=Q6414:
    get:
      tags:
        - kartotherian
        - maps
        - geojson
      description: Returns a json representation of a given shape
      x-monitor: false
      produces:
        - application/vnd.geo+json
      x-amples:
        - title: get Lake Garda geojson
          response:
            status: 200
            headers:
              content-type: application/vnd.geo+json; charset=utf-8
  # from routes/root.js
  /robots.txt:
    get:
      tags:
        - Root
        - Robots
      description: Gets robots.txt
      x-monitor: false
  /:
    get:
      tags:
        - Root
      description: The root service end-point
      x-monitor: false
      produces:
        - application/json
  # from routes/info.js
  /_info:
    get:
      tags:
        - Service information
      description: Gets information about the service
      x-monitor: true
      produces:
        - application/json
  /_info/name:
    get:
      tags:
        - Service information
        - Service name
      description: Gets the name of the service
      x-monitor: false
      produces:
        - application/json
  /_info/version:
    get:
      tags:
        - Service information
        - Service version
      description: Gets the running version of the service
      x-monitor: false
      produces:
        - application/json
  /_info/home:
    get:
      tags:
        - Service information
        - Service homepage
      description: Redirects to the home page
      x-monitor: false
