( schema: JSONSchema7, parentTypeName: string, ctx: RustCodegenCtx, )
| 490 | } |
| 491 | |
| 492 | function rustMapValueType( |
| 493 | schema: JSONSchema7, |
| 494 | parentTypeName: string, |
| 495 | ctx: RustCodegenCtx, |
| 496 | ): string { |
| 497 | const additionalProperties = schema.additionalProperties; |
| 498 | if ( |
| 499 | additionalProperties && |
| 500 | typeof additionalProperties === "object" && |
| 501 | Object.keys(additionalProperties as Record<string, unknown>).length > 0 |
| 502 | ) { |
| 503 | const valueSchema = additionalProperties as JSONSchema7; |
| 504 | if (valueSchema.type === "object" && valueSchema.properties) { |
| 505 | const valueName = (valueSchema.title as string) || `${parentTypeName}Value`; |
| 506 | emitRustStruct(valueName, valueSchema, ctx); |
| 507 | return valueName; |
| 508 | } |
| 509 | return resolveRustType(valueSchema, parentTypeName, "value", true, ctx); |
| 510 | } |
| 511 | return "serde_json::Value"; |
| 512 | } |
| 513 | |
| 514 | function rustMapType( |
| 515 | schema: JSONSchema7, |
no test coverage detected
searching dependent graphs…