Skip to content

Conversation

@lavie
Copy link
Contributor

@lavie lavie commented Dec 31, 2017

The Ports field is a map of string to array of Ip/Port objects, as you
can see in the docs: https://docs.docker.com/engine/api/v1.32/#operation/ContainerInspect

As a result of this error type checks are not being run. e.g. Doing
container.inspect().NetworkSettings.Ports['test'][0].BadField will
compile without error, despite BadField to existing in the interface.

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

If changing an existing definition:

The Ports field is a map of string to _array_ of Ip/Port objects, as you
can see in the docs: https://docs.docker.com/engine/api/v1.32/#operation/ContainerInspect

As a result of this error type checks are not being run. e.g. Doing
`container.inspect().NetworkSettings.Ports['test'][0].BadField` will
compile without error, despite `BadField` to existing in the interface.
@lavie lavie changed the title Fix ContainerInspectInfo according to Docker REST API documentation. dockerode: Fix ContainerInspectInfo according to Docker REST API documentation. Dec 31, 2017
@lavie
Copy link
Contributor Author

lavie commented Dec 31, 2017

(kudos on the friendly and to-the-point pull-request to-do injection. it was a pleasure to follow)

@mhegazy mhegazy merged commit 6d020e2 into DefinitelyTyped:master Jan 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants