autorest icon indicating copy to clipboard operation
autorest copied to clipboard

Support for schema properties named after JS reserved name

Open timotheeguerin opened this issue 3 years ago • 1 comments

Right now having an openapi spec with a schema having a property named with values already used by JS objects causes collision error.

Keywords:

  • [ ] toString #3530
  • [ ] constructor
  • [ ] call

Workaround:

Rename the property and use x-ms-client-name

{
 "toString": { ... }

->

{
  "toStringProp": { 
    "x-ms-client-name": "toString", ...
  }
}

timotheeguerin avatar Mar 31 '21 23:03 timotheeguerin

Check if it fails correctly and close as by design. Workaround can be used if really on purpose.

timotheeguerin avatar Apr 04 '22 22:04 timotheeguerin