File tree 1 file changed +17
-17
lines changed
packages/openapi-generator/src
1 file changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -239,26 +239,26 @@ function parseObjectExpression(
239
239
240
240
let name : string = '' ;
241
241
if ( property . key . type === 'Computed' ) {
242
- if ( property . key . expression . type !== 'Identifier' ) {
243
- return errorLeft (
244
- `Unimplemented computed property value type ${ property . value . type } ` ,
245
- ) ;
246
- }
247
-
248
- const initE = findSymbolInitializer (
249
- project ,
250
- source ,
251
- property . key . expression . value ,
252
- ) ;
253
- if ( E . isLeft ( initE ) ) {
254
- return initE ;
255
- }
256
- const [ newSourceFile , init ] = initE . right ;
257
- const valueE = parsePlainInitializer ( project , newSourceFile , init ) ;
242
+ const valueE = parseCodecInitializer ( project , source , property . key . expression ) ;
258
243
if ( E . isLeft ( valueE ) ) {
259
244
return valueE ;
260
245
}
261
- const schema = valueE . right ;
246
+ let schema = valueE . right ;
247
+ if ( schema . type === 'ref' ) {
248
+ const realInitE = findSymbolInitializer ( project , source , schema . name ) ;
249
+ if ( E . isLeft ( realInitE ) ) {
250
+ return realInitE ;
251
+ }
252
+ const schemaE = parsePlainInitializer (
253
+ project ,
254
+ realInitE . right [ 0 ] ,
255
+ realInitE . right [ 1 ] ,
256
+ ) ;
257
+ if ( E . isLeft ( schemaE ) ) {
258
+ return schemaE ;
259
+ }
260
+ schema = schemaE . right ;
261
+ }
262
262
if (
263
263
( schema . type === 'string' || schema . type === 'number' ) &&
264
264
schema . enum !== undefined
You can’t perform that action at this time.
0 commit comments