Skip to content

Commit

Permalink
api: fix children type in Snapshot schema
Browse files Browse the repository at this point in the history
Signed-off-by: Michael William Le Nguyen <michael@mail.ttp.codes>
  • Loading branch information
ttpcodes authored and yasker committed Jun 29, 2020
1 parent c016607 commit 8359950
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion api/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ func NewSchema() *client.Schemas {
schemas.AddType("apiVersion", client.Resource{})
schemas.AddType("schema", client.Schema{})
schemas.AddType("error", client.ServerApiError{})
schemas.AddType("snapshot", Snapshot{})
schemas.AddType("attachInput", AttachInput{})
schemas.AddType("snapshotInput", SnapshotInput{})
schemas.AddType("backup", Backup{})
Expand Down Expand Up @@ -342,6 +341,7 @@ func NewSchema() *client.Schemas {
schemas.AddType("instanceProcess", types.InstanceProcess{})

volumeSchema(schemas.AddType("volume", Volume{}))
snapshotSchema(schemas.AddType("snapshot", Snapshot{}))
backupVolumeSchema(schemas.AddType("backupVolume", BackupVolume{}))
settingSchema(schemas.AddType("setting", Setting{}))
recurringSchema(schemas.AddType("recurringInput", RecurringInput{}))
Expand Down Expand Up @@ -626,6 +626,12 @@ func volumeSchema(volume *client.Schema) {
volume.ResourceFields["rebuildStatus"] = rebuildStatus
}

func snapshotSchema(snapshot *client.Schema) {
children := snapshot.ResourceFields["children"]
children.Type = "map[bool]"
snapshot.ResourceFields["children"] = children
}

func backupListOutputSchema(backupList *client.Schema) {
data := backupList.ResourceFields["data"]
data.Type = "array[backup]"
Expand Down

0 comments on commit 8359950

Please sign in to comment.