{"record":{"id":"217dae5146151cc7","repo":"opendataloader-project/opendataloader-pdf","slug":"unsupported-format-s-supported-values-json-t","errorCode":null,"errorMessage":"Unsupported format '%s'. Supported values: json, text, html, pdf, markdown, tagged-pdf","messagePattern":"Unsupported format '(.+?)'\\. Supported values: json, text, html, pdf, markdown, tagged-pdf","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/api/cli/CLIOptions.java","lineNumber":626,"sourceCode":"                case \"markdown\":\n                    config.setGenerateMarkdown(true);\n                    break;\n                case \"markdown-with-html\":\n                    System.err.println(\"[WARN] --format markdown-with-html is deprecated and will be removed \"\n                            + \"in the next major release. Use --format markdown --markdown-with-html instead.\");\n                    config.setUseHTMLInMarkdown(true);\n                    break;\n                case \"markdown-with-images\":\n                    System.err.println(\"[WARN] --format markdown-with-images is deprecated and will be removed \"\n                            + \"in the next major release. Use --format markdown with --image-output \"\n                            + \"(off|embedded|external) instead.\");\n                    config.setGenerateMarkdown(true);\n                    break;\n                case \"tagged-pdf\":\n                    config.setGenerateTaggedPDF(true);\n                    break;\n                default:\n                    throw new IllegalArgumentException(String.format(\n                            \"Unsupported format '%s'. Supported values: json, text, html, pdf, markdown, tagged-pdf\",\n                            value));\n            }\n        }\n    }\n\n    private static Set<String> parseOptionValues(String[] optionValues) {\n        Set<String> values = new LinkedHashSet<>();\n        for (String rawValue : optionValues) {\n            if (rawValue == null) {\n                continue;\n            }\n            String[] splitValues = rawValue.split(\",\");\n            for (String candidate : splitValues) {\n                String format = candidate.trim().toLowerCase(Locale.ROOT);\n                if (!format.isEmpty()) {\n                    values.add(format);\n                }","sourceCodeStart":608,"sourceCodeEnd":644,"githubUrl":"https://github.com/opendataloader-project/opendataloader-pdf/blob/a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8/java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/api/cli/CLIOptions.java#L608-L644","documentation":"Thrown by the default branch of the format switch when a parsed value matches no case. Recognized cases are json, text, html, pdf, markdown, tagged-pdf, plus deprecated markdown-with-html and markdown-with-images (accepted with a warning). Any other token is rejected with the offending value and the canonical supported list (which omits the deprecated names).","triggerScenarios":"Pass `--format md` (markdown is the full token), `--format txt`, `--format JSON` (case is NOT normalized for format values — the switch is case-sensitive, unlike image-format/table-method), or a typo like `markdwon`.","commonSituations":"Using common abbreviations (md, txt, htm) that are not accepted; uppercase values (this option does not lowercase, so case matters); assuming a deprecated alias still works after removal.","solutions":["Use the full lowercase token: json, text, html, pdf, markdown, or tagged-pdf.","Replace md with markdown and txt with text.","If you used markdown-with-html, prefer `--format markdown --markdown-with-html`."],"exampleFix":"// before\nopendataloader-pdf doc.pdf --format md\n// after\nopendataloader-pdf doc.pdf --format markdown","handlingStrategy":"validation","validationCode":"Set<String> ALLOWED = Set.of(\"json\", \"text\", \"html\", \"pdf\", \"markdown\", \"tagged-pdf\");\n// NOTE: --format is case-sensitive (no lowercasing in the switch)\nfor (String value : parseOptionValues(commandLine.getOptionValues(\"format\"))) {\n    if (!ALLOWED.contains(value)) throw new IllegalArgumentException(\"Bad --format token: \" + value);\n}","typeGuard":"boolean isAcceptableFormatToken(String v) {\n    return Set.of(\"json\", \"text\", \"html\", \"pdf\", \"markdown\", \"tagged-pdf\").contains(v);\n}","tryCatchPattern":"try {\n    CLIOptions.applyAllTo(config, cmd);\n} catch (IllegalArgumentException e) {\n    System.err.println(e.getMessage());\n    System.exit(2);\n}","preventionTips":["Use full lowercase tokens; avoid md/txt/htm abbreviations.","Remember --format is case-sensitive — do not uppercase.","For HTML-in-markdown use `--format markdown` plus `--markdown-with-html`, not the deprecated format alias."],"tags":["cli","format","validation","enum-value","case-sensitive"],"backgroundTag":null,"analyzedSha":"a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8","analyzedAt":"2026-08-14T05:22:03.953Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}