#type: collection
get:
  is: [ embeddable: { embedFields: "user,map" }, orderable, pageable ]
  securedBy: [ null, token, oauth_2_0, cookie ]
  responses:
    200:
      body:
        application/json:
          example: !include ../examples/mappings.json
post:
  body:
    application/json:
      properties:
        mappable_id:
          description: id of the topic/synapse to be mapped
        mappable_type:
          description: Topic or Synapse
        map_id:
          description: id of the map
        xloc:
          description: (only for Topic mappings) x location on the canvas
          required: false
        yloc:
          description: (only for Topic mappings) y location on the canvas
          required: false
  responses:
    201:
      body:
        application/json:
          example: !include ../examples/mapping.json
/{id}:
  #type: item
  get:
    is: [ embeddable: { embedFields: "user,map" } ]
    securedBy: [ null, token, oauth_2_0, cookie ]
    responses:
      200:
        body:
          application/json:
            example: !include ../examples/mapping.json
  put:
    body:
      application/json:
        properties:
          mappable_id:
            description: id of the topic/synapse to be mapped
            required: false
          mappable_type:
            description: Topic or Synapse
            required: false
          map_id:
            description: id of the map
            required: false
          xloc:
            description: (only for Topic mappings) x location on the canvas
            required: false
          yloc:
            description: (only for Topic mappings) y location on the canvas
            required: false

    responses:
      200:
        body:
          application/json:
            example: !include ../examples/mapping.json
  patch:
    body:
      application/json:
        properties:
          mappable_id:
            description: id of the topic/synapse to be mapped
            required: false
          mappable_type:
            description: Topic or Synapse
            required: false
          map_id:
            description: id of the map
            required: false
          xloc:
            description: (only for Topic mappings) x location on the canvas
            required: false
          yloc:
            description: (only for Topic mappings) y location on the canvas
            required: false
    responses:
      200:
        body:
          application/json:
            example: !include ../examples/mapping.json
  delete:
    responses:
      204:
        description: No content
