Skip to content

Commit

Permalink
Fixes map[string]struct{} as dictionary
Browse files Browse the repository at this point in the history
Resolves: #139 in that docker handles Config.Volumes very specifically.
Rather than being a map of string struct it actually only uses the keys
which serializes as a flat list of string.
  • Loading branch information
jterry75 committed Jan 5, 2017
1 parent dec0602 commit 3539122
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Docker.DotNet/Models/Config.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class Config // (container.Config)
public string Image { get; set; }

[DataMember(Name = "Volumes", EmitDefaultValue = false)]
public IDictionary<string, object> Volumes { get; set; }
public IList<string> Volumes { get; set; }

[DataMember(Name = "WorkingDir", EmitDefaultValue = false)]
public string WorkingDir { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public CreateContainerParameters(Config Config)
public string Image { get; set; }

[DataMember(Name = "Volumes", EmitDefaultValue = false)]
public IDictionary<string, object> Volumes { get; set; }
public IList<string> Volumes { get; set; }

[DataMember(Name = "WorkingDir", EmitDefaultValue = false)]
public string WorkingDir { get; set; }
Expand Down
1 change: 1 addition & 0 deletions tools/specgen/specgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
)

var typeCustomizations = map[typeCustomizationKey]CSType{
{reflect.TypeOf(container.Config{}), "Volumes"}: {"System.Collections.Generic", "IList<string>", false},
{reflect.TypeOf(container.RestartPolicy{}), "Name"}: {"", "RestartPolicyKind", false},
{reflect.TypeOf(types.Container{}), "Created"}: {"System", "DateTime", false},
{reflect.TypeOf(types.ContainerChange{}), "Kind"}: {"", "FileSystemChangeKind", false},
Expand Down

0 comments on commit 3539122

Please sign in to comment.