{"record":{"id":"cb189c229f7edb80","repo":"OpenAPITools/openapi-generator","slug":"invalid-query-param-object-format-s-must-be-on","errorCode":null,"errorMessage":"Invalid query param object format '%s'. Must be one of %s.","messagePattern":"Invalid query param object format '(.+?)'\\. Must be one of (.+?)\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java","lineNumber":714,"sourceCode":"            );\n        }\n    }\n\n    /**\n     * Set the query param object format.\n     *\n     * @param format the query param object format to use\n     */\n    public void setQueryParamObjectFormat(String format) {\n        try {\n            queryParamObjectFormat = QUERY_PARAM_OBJECT_FORMAT_TYPE.valueOf(format);\n        } catch (IllegalArgumentException e) {\n            String values = Stream.of(QUERY_PARAM_OBJECT_FORMAT_TYPE.values())\n                    .map(value -> \"'\" + value.name() + \"'\")\n                    .collect(Collectors.joining(\", \"));\n\n            String msg = String.format(Locale.ROOT, \"Invalid query param object format '%s'. Must be one of %s.\", format, values);\n            throw new IllegalArgumentException(msg);\n        }\n    }\n\n    /**\n     * Set the file naming type.\n     *\n     * @param fileNaming the file naming to use\n     */\n    private void setFileNaming(String fileNaming) {\n        if (\"camelCase\".equals(fileNaming) || \"kebab-case\".equals(fileNaming)) {\n            this.fileNaming = fileNaming;\n        } else {\n            throw new IllegalArgumentException(\"Invalid file naming '\" +\n                    fileNaming + \"'. Must be 'camelCase' or 'kebab-case'\");\n        }\n    }\n\n    /**","sourceCodeStart":696,"sourceCodeEnd":732,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java#L696-L732","documentation":"queryParamObjectFormat controls how objects are serialized into query parameters. The value is parsed into an enum whose only members are 'dot', 'json' and 'key'; any other string triggers IllegalArgumentException, with the accepted list included in the message.","triggerScenarios":"-DqueryParamObjectFormat=nestjs, 'key-value', 'brackets' or any value other than dot/json/key.","commonSituations":"Guessing serialization names from other ecosystems (nestjs, qs-style 'brackets', 'comma'); copying the option from a different generator with another value set; typos like 'Json'.","solutions":["Use one of the supported values: 'key', 'json' or 'dot'.","Omit the option to keep the default serialization."],"exampleFix":"# before\n-DqueryParamObjectFormat=nestjs\n\n# after\n-DqueryParamObjectFormat=key","handlingStrategy":"type-guard","validationCode":"// node: verify the value before passing it to the generator\nconst FORMATS = ['dot', 'json', 'key'];\nif (opts.queryParamObjectFormat && !FORMATS.includes(opts.queryParamObjectFormat))\n  throw new Error(`queryParamObjectFormat must be one of ${FORMATS.join('|')}`);","typeGuard":"const QUERY_PARAM_FORMATS = ['dot', 'json', 'key'] as const;\nexport type QueryParamFormat = typeof QUERY_PARAM_FORMATS[number];\nconst isQueryParamFormat = (v: string): v is QueryParamFormat =>\n  (QUERY_PARAM_FORMATS as readonly string[]).includes(v);","tryCatchPattern":"// Java\ntry { new DefaultGenerator().opts(input).generate(); }\ncatch (IllegalArgumentException e) {\n    // message lists the accepted values; correct the option and rerun once\n}","preventionTips":["Model generator enums in your config code as union types, not raw strings.","Check the enum values in the generator's message rather than guessing serialization names.","Centralize option constants in one module consumed by all generation scripts."],"tags":["typescript","angular","configuration","query-params"],"backgroundTag":"invalid-option-value","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}