Skip to content

Commit

Permalink
add example of #316
Browse files Browse the repository at this point in the history
  • Loading branch information
carueda committed Jan 1, 2025
1 parent 2aa1790 commit 173cefe
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/main/tscfg/example/issue316.spec.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// GenOpts: --skip-gen4tests

#@define
User = {
name: string
age: integer
}

# A map of users
users : { "[string]" : User }

# A map with inlined object as value type
#@optional
otherMap : {
"[string]" : {
foo: string
baz: integer
}
}

# Map related invalid cases:
# (1) multiple map defining keys are not allowed
# (2) no other fields allowed when a map is defined
# (3) Only `string` is allowed as key type (other types may be supported in the future)
# (4) Map defining key at first level is not allowed

otherMap2 : {
"[string]" : { foo: string } # OK
# "[String]" : int # (1)
# otherStuff: string # (2)
# "[int]" : string # (3)
}

# "[string]" : long # (4)

0 comments on commit 173cefe

Please sign in to comment.