(member: JSONSchema7, ctx: GoCodegenCtx)
| 2498 | } |
| 2499 | |
| 2500 | function goPrimitiveUnionGoType(member: JSONSchema7, ctx: GoCodegenCtx): string | undefined { |
| 2501 | const resolved = resolveGoUnionMember(member, ctx.definitions); |
| 2502 | if (resolved.enum || resolved.const !== undefined) return undefined; |
| 2503 | |
| 2504 | if (resolved.type === "array") { |
| 2505 | const items = resolved.items && typeof resolved.items === "object" && !Array.isArray(resolved.items) |
| 2506 | ? resolved.items as JSONSchema7 |
| 2507 | : undefined; |
| 2508 | if (!items) return undefined; |
| 2509 | const itemType = goPrimitiveSchemaGoType(items, ctx); |
| 2510 | return itemType ? `[]${itemType}` : undefined; |
| 2511 | } |
| 2512 | |
| 2513 | return goPrimitiveSchemaGoType(resolved, ctx); |
| 2514 | } |
| 2515 | |
| 2516 | function goPrimitiveUnionVariantTypeName(typeName: string, valueName: string): string { |
| 2517 | if (typeName.endsWith("FieldValue")) { |
no test coverage detected
searching dependent graphs…