#type: collection
get:
  is: [ searchable: { searchFields: "name, desc, link" }, embeddable: { embedFields: "user,metacode" }, orderable, pageable ]
  responses:
    200:
      body:
        application/json:
          example: !include ../examples/topics.json
post:
  body:
    application/json:
      properties:
        name:
          description: Topic name; this will be visible on the map
        desc:
          description: Longer topic description visible when opening a map card
        link:
          description: embed a link to content on the web in the topic card
          required: false
        permission:
          description: commons, public, or private
        metacode_id:
          description: Topic's metacode
  responses:
    201:
      body:
        application/json:
          example: !include ../examples/topic.json
/{id}:
  #type: item
  get:
    is: [ embeddable: { embedFields: "user,metacode" } ]
    responses:
      200:
        body:
          application/json:
            example: !include ../examples/topic.json
  put:
    body:
      application/json:
        properties:
          name:
            description: Topic name; this will be visible on the map
            required: false
          desc:
            description: Longer topic description visible when opening a map card
            required: false
          link:
            description: embed a link to content on the web in the topic card
            required: false
          permission:
            description: commons, public, or private
            required: false
          metacode_id:
            description: Topic's metacode
            required: false
    responses:
      200:
        body:
          application/json:
            example: !include ../examples/topic.json
  patch:
    body:
      application/json:
        properties:
          name:
            description: Topic name; this will be visible on the map
            required: false
          desc:
            description: Longer topic description visible when opening a map card
            required: false
          link:
            description: embed a link to content on the web in the topic card
            required: false
          permission:
            description: commons, public, or private
            required: false
          metacode_id:
            description: Topic's metacode
            required: false
    responses:
      200:
        body:
          application/json:
            example: !include ../examples/topic.json
  delete:
    responses:
      204:
        description: No content