Use reserved keywords in type filed names

I’ve a json configuration file that I’m trying to make into a type, however one of the fields of this json has this name extends which is reserved key word.

Can I use a fieldname extends in a c3 type, something like this:

type MyConfig {
    extends: string
    ...
}

If not then how can I serialize this type into json and get in the final result the key extends?

I believe you can “escape” reserved DSL words for use as field names by prefixing them with a backtick:

type MyConfig {
  `extends: string
  ...
}
1 Like