···120120 const properties: Property[] = model.properties.map((property) => {
121121 let maybeRequired = property.isRequired ? '' : '?';
122122 let value = toType(property);
123123+ let name = isStandalone
124124+ ? escapeName(unescapeName(transformTypeKeyName(property.name)))
125125+ : // special test for 1XX status codes. We need a more robust system
126126+ // for escaping values depending on context in which they're printed,
127127+ // but since this works for standalone client, it's not worth it right now
128128+ /^\dXX$/.test(property.name)
129129+ ? escapeName(property.name)
130130+ : property.name;
123131 // special case for additional properties type
124124- if (property.name === '[key: string]' && maybeRequired) {
125125- maybeRequired = '';
126126- value = compiler.typedef.union([value, 'undefined']);
132132+ if (property.name === '[key: string]') {
133133+ name = property.name;
134134+ if (maybeRequired) {
135135+ maybeRequired = '';
136136+ value = compiler.typedef.union([value, 'undefined']);
137137+ }
127138 }
128139 return {
129140 comment: [
···132143 ],
133144 isReadOnly: property.isReadOnly,
134145 isRequired: maybeRequired === '',
135135- name: isStandalone
136136- ? escapeName(unescapeName(transformTypeKeyName(property.name)))
137137- : // special test for 1XX status codes. We need a more robust system
138138- // for escaping values depending on context in which they're printed,
139139- // but since this works for standalone client, it's not worth it right now
140140- /^\dXX$/.test(property.name)
141141- ? escapeName(property.name)
142142- : property.name,
146146+ name,
143147 type: value,
144148 };
145149 });