Skip to content

Commit

Permalink
docs: api: document w (width) and h (height) query params as required
Browse files Browse the repository at this point in the history
Query parameters default to being _optional_ in swagger, but for these
endpoints, they were required. Omitting these parameters (or passing an
empty value) produces a 400 (bad request);

    docker run -d --name foo nginx:alpine

    curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/containers/foo/resize'
    {"message":"strconv.Atoi: parsing \"\": invalid syntax"}

    curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/containers/foo/resize?w='
    {"message":"strconv.Atoi: parsing \"\": invalid syntax"}

    curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/containers/foo/resize?w=&h='
    {"message":"strconv.Atoi: parsing \"\": invalid syntax"}

    curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/containers/foo/resize?w=100&h='
    {"message":"strconv.Atoi: parsing \"\": invalid syntax"}

    curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/containers/foo/resize?w=100&h=100'

This patch updates the swagger to reflect that these parameters are required.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Oct 14, 2024
1 parent 2a3a7e8 commit d9627b6
Show file tree
Hide file tree
Showing 23 changed files with 92 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/api/v1.25.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3501,10 +3501,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the tty session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the tty session in characters"
type: "integer"
tags: ["Container"]
Expand Down Expand Up @@ -5721,10 +5723,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the TTY session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the TTY session in characters"
type: "integer"
tags: ["Exec"]
Expand Down
4 changes: 4 additions & 0 deletions docs/api/v1.26.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3505,10 +3505,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the tty session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the tty session in characters"
type: "integer"
tags: ["Container"]
Expand Down Expand Up @@ -5729,10 +5731,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the TTY session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the TTY session in characters"
type: "integer"
tags: ["Exec"]
Expand Down
4 changes: 4 additions & 0 deletions docs/api/v1.27.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3572,10 +3572,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the tty session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the tty session in characters"
type: "integer"
tags: ["Container"]
Expand Down Expand Up @@ -5803,10 +5805,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the TTY session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the TTY session in characters"
type: "integer"
tags: ["Exec"]
Expand Down
4 changes: 4 additions & 0 deletions docs/api/v1.28.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3663,10 +3663,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the tty session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the tty session in characters"
type: "integer"
tags: ["Container"]
Expand Down Expand Up @@ -5918,10 +5920,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the TTY session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the TTY session in characters"
type: "integer"
tags: ["Exec"]
Expand Down
4 changes: 4 additions & 0 deletions docs/api/v1.29.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3696,10 +3696,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the tty session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the tty session in characters"
type: "integer"
tags: ["Container"]
Expand Down Expand Up @@ -5951,10 +5953,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the TTY session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the TTY session in characters"
type: "integer"
tags: ["Exec"]
Expand Down
4 changes: 4 additions & 0 deletions docs/api/v1.30.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3921,10 +3921,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the tty session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the tty session in characters"
type: "integer"
tags: ["Container"]
Expand Down Expand Up @@ -6205,10 +6207,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the TTY session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the TTY session in characters"
type: "integer"
tags: ["Exec"]
Expand Down
4 changes: 4 additions & 0 deletions docs/api/v1.31.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3990,10 +3990,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the tty session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the tty session in characters"
type: "integer"
tags: ["Container"]
Expand Down Expand Up @@ -6297,10 +6299,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the TTY session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the TTY session in characters"
type: "integer"
tags: ["Exec"]
Expand Down
4 changes: 4 additions & 0 deletions docs/api/v1.32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5223,10 +5223,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the tty session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the tty session in characters"
type: "integer"
tags: ["Container"]
Expand Down Expand Up @@ -7335,10 +7337,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the TTY session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the TTY session in characters"
type: "integer"
tags: ["Exec"]
Expand Down
4 changes: 4 additions & 0 deletions docs/api/v1.33.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5227,10 +5227,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the tty session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the tty session in characters"
type: "integer"
tags: ["Container"]
Expand Down Expand Up @@ -7343,10 +7345,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the TTY session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the TTY session in characters"
type: "integer"
tags: ["Exec"]
Expand Down
4 changes: 4 additions & 0 deletions docs/api/v1.34.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5255,10 +5255,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the tty session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the tty session in characters"
type: "integer"
tags: ["Container"]
Expand Down Expand Up @@ -7383,10 +7385,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the TTY session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the TTY session in characters"
type: "integer"
tags: ["Exec"]
Expand Down
4 changes: 4 additions & 0 deletions docs/api/v1.35.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5263,10 +5263,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the tty session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the tty session in characters"
type: "integer"
tags: ["Container"]
Expand Down Expand Up @@ -7416,10 +7418,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the TTY session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the TTY session in characters"
type: "integer"
tags: ["Exec"]
Expand Down
4 changes: 4 additions & 0 deletions docs/api/v1.36.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5283,10 +5283,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the tty session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the tty session in characters"
type: "integer"
tags: ["Container"]
Expand Down Expand Up @@ -7450,10 +7452,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the TTY session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the TTY session in characters"
type: "integer"
tags: ["Exec"]
Expand Down
4 changes: 4 additions & 0 deletions docs/api/v1.37.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5303,10 +5303,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the tty session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the tty session in characters"
type: "integer"
tags: ["Container"]
Expand Down Expand Up @@ -7493,10 +7495,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the TTY session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the TTY session in characters"
type: "integer"
tags: ["Exec"]
Expand Down
4 changes: 4 additions & 0 deletions docs/api/v1.38.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5364,10 +5364,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the tty session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the tty session in characters"
type: "integer"
tags: ["Container"]
Expand Down Expand Up @@ -7564,10 +7566,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the TTY session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the TTY session in characters"
type: "integer"
tags: ["Exec"]
Expand Down
4 changes: 4 additions & 0 deletions docs/api/v1.39.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6654,10 +6654,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the TTY session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the TTY session in characters"
type: "integer"
tags: ["Container"]
Expand Down Expand Up @@ -8836,10 +8838,12 @@ paths:
type: "string"
- name: "h"
in: "query"
required: true
description: "Height of the TTY session in characters"
type: "integer"
- name: "w"
in: "query"
required: true
description: "Width of the TTY session in characters"
type: "integer"
tags: ["Exec"]
Expand Down
Loading

0 comments on commit d9627b6

Please sign in to comment.