# Like patch.yaml, but for things that are not inconsistencies in the
# spec.  This is used to add hints to the swagger preparer to keep the
# code there simple, and will be used to add docstrings for arguments
# and methods that are modified in docker_client.R
- path: ["paths", "/containers/{id}/logs", "get"]
  value:
    produces: "application/chunked-string"

- path: ["paths", "/build", "post", "parameters", "@name = t"]
  value:
    multiple: true
    # Based on the wording from 1.29, modified to be reflect how the
    # tag parameter is handled by stevedore:
    description: A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default `latest` value is assumed. You can provide a vector of mutiple tags here.

# See issue #8 - I think that the spec is incorrect here - the docker
# client itself does not follow what the spec requires
- path: ["paths", "/images/get", "get", "parameters", "@name = names"]
  value:
    multiple: true
    type: "string"
    items: ~

# This group is all documentation for the 'filter' parameter
- path: ["paths", "/containers/json", "get", "parameters", "@name = filters",
  "description"]
  transform: patch_doc_filters

- path: ["paths", "/containers/prune", "post", "parameters", "@name = filters",
  "description"]
  transform: patch_doc_filters

- path: ["paths", "/images/json", "get", "parameters", "@name = filters",
  "description"]
  transform: patch_doc_filters

- path: ["paths", "/images/search", "get", "parameters", "@name = filters",
  "description"]
  transform: patch_doc_filters

- path: ["paths", "/images/prune", "post", "parameters", "@name = filters",
  "description"]
  transform: patch_doc_filters

- path: ["paths", "/events", "get", "parameters", "@name = filters",
  "description"]
  transform: patch_doc_filters

- path: ["paths", "/volumes", "get", "parameters", "@name = filters",
  "description"]
  transform: patch_doc_filters

- path: ["paths", "/volumes/prune", "post", "parameters", "@name = filters",
  "description"]
  transform: patch_doc_filters

- path: ["paths", "/networks", "get", "parameters", "@name = filters",
  "description"]
  transform: patch_doc_filters

- path: ["paths", "/networks/prune", "post", "parameters", "@name = filters",
  "description"]
  transform: patch_doc_filters

- path: ["paths", "/services", "get", "parameters", "@name = filters",
  "description"]
  transform: patch_doc_filters

- path: ["paths", "/nodes", "get", "parameters", "@name = filters",
  "description"]
  transform: patch_doc_filters

- path: ["paths", "/secrets", "get", "parameters", "@name = filters",
  "description"]
  transform: patch_doc_filters

- path: ["paths", "/tasks", "get", "parameters", "@name = filters",
  "description"]
  transform: patch_doc_filters

- path: ["definitions", "SecretSpec", "properties", "Data", "description"]
  value: "Secret data, as a raw vector or character string"

# totally different!

- version: ["1.25", "1.29"]
  path: ["definitions", "Config", "properties", "ExposedPorts", "description"]
  value: &container-ports >-
    A character vector of port mappings between the container and
    host, in (1) the form `<host>:<container>` (e.g., `10080:80` to
    map the container's port 80 to the host's port 10080),
    `<ip>:<host>:<container>` to bind a specific host interface as
    well as a port (e.g., you can use `localhost` or `127.0.0.1` for
    the first element), (3) form `<port>` to map the containers port
    to a random available port on the host s shorthand for
    `<port>:<port>`, or (3) a single logical value `TRUE` indicating
    to map all container ports to random available ports on the host.
    You can use the `$ports()` method in the `?docker_container`
    object to query the port mapping of a running container.  Multiple
    values can be provided to map multiple ports to the host (e.g.,
    `c("80", "443:443")`.

- version: ["1.25", "1.29"]
  path: ["definitions", "Config", "properties", "Volumes", "description"]
  value: &container-volumes >-
    A character vector of mappings of mount points on the host (or in
    volumes) to paths on the container.  Each element must be of the
    form `<path_host>:<path_container>`, possibly followed by `:ro`
    for read-only mappings (i.e., the same syntax as the docker
    command line client).

    `?docker_volume` objects have a `$map` method to help with
    generating these paths for volume mappings.

- version: ["1.30", "1.36"]
  path: ["definitions", "ContainerConfig", "properties", "ExposedPorts", "description"]
  value: *container-ports

- version: ["1.30", "1.36"]
  path: ["definitions", "ContainerConfig", "properties", "Volumes", "description"]
  value: *container-volumes
