(resultType: string, allImports: Set<string>, packageName: string)
| 1629 | } |
| 1630 | |
| 1631 | function addWrapperResultImports(resultType: string, allImports: Set<string>, packageName: string): void { |
| 1632 | if (resultType === "Void") { |
| 1633 | return; |
| 1634 | } |
| 1635 | |
| 1636 | if (resultType === "JsonNode") { |
| 1637 | allImports.add("com.fasterxml.jackson.databind.JsonNode"); |
| 1638 | return; |
| 1639 | } |
| 1640 | |
| 1641 | if (resultType.startsWith("List<")) { |
| 1642 | allImports.add("java.util.List"); |
| 1643 | } |
| 1644 | |
| 1645 | const builtInTypes = new Set(["Boolean", "Double", "Long", "List", "Object", "String", "Void"]); |
| 1646 | for (const typeName of resultType.match(/\b[A-Z][A-Za-z0-9_]*\b/g) ?? []) { |
| 1647 | if (!builtInTypes.has(typeName)) { |
| 1648 | allImports.add(`${packageName}.${typeName}`); |
| 1649 | } |
| 1650 | } |
| 1651 | } |
| 1652 | |
| 1653 | /** |
| 1654 | * Return the params class name if the method has a params schema with properties |
no test coverage detected
searching dependent graphs…