diff --git a/README.md b/README.md index 01bbb53..83e5663 100644 --- a/README.md +++ b/README.md @@ -705,6 +705,8 @@ type SchemaSwitch struct { // Each key = the value for the field being evaluated (ex: "turtle") // Each value = the struct that holds the jsonschema tags to validate against when it is that value (ex: Turtle{}) Cases map[string]interface{} + // Order - the fields from `Cases` can be provided here to guarantee output in specified order, otherwise this will be seeded internally + Order []string } ``` diff --git a/subschemas_switch.go b/subschemas_switch.go index d31bbb8..27542e7 100644 --- a/subschemas_switch.go +++ b/subschemas_switch.go @@ -40,7 +40,7 @@ type SchemaSwitch struct { // Each key = the value for the field being evaluated (ex: "turtle") // Each value = the struct that holds the jsonschema tags to validate against when it is that value (ex: Turtle{}) Cases map[string]interface{} - // Order = Elements present based on insertion oreder + // Order - the fields from `Cases` can be provided here to guarantee output in specified order, otherwise this will be seeded internally Order []string }