(schema: JSONSchema7, ctx: GoCodegenCtx)
| 1235 | } |
| 1236 | |
| 1237 | function goObjectSchemaForMatch(schema: JSONSchema7, ctx: GoCodegenCtx): JSONSchema7 | undefined { |
| 1238 | const resolved = resolveSchema(schema, ctx.definitions) ?? schema; |
| 1239 | const objectSchema = resolveObjectSchema(resolved, ctx.definitions) ?? resolved; |
| 1240 | if (objectSchema?.properties || objectSchema?.type === "object" || objectSchema?.additionalProperties === false) { |
| 1241 | return objectSchema; |
| 1242 | } |
| 1243 | return undefined; |
| 1244 | } |
| 1245 | |
| 1246 | function goSchemaNeedsJSONMatch(schema: JSONSchema7, ctx: GoCodegenCtx): boolean { |
| 1247 | if (goObjectSchemaForMatch(schema, ctx)) return true; |
no test coverage detected
searching dependent graphs…