OpenAPITools / OpenAPITools/openapi-generator
[BUG] `sortParamsByRequiredFlag` error on https://api.openapi-generator.tech for /api/gen/clients/{language} where language=c
Open
Nobody has claimed this yet.
Issue: Bug
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
{
"sortParamsByRequiredFlag": {
"opt": "sortParamsByRequiredFlag",
"description": "Sort method arguments to place required parameters before optional parameters.",
"type": "boolean",
"optValue": null,
"default": "true",
"enum": null
},
"sortModelPropertiesByRequiredFlag": {
"opt": "sortModelPropertiesByRequiredFlag",
"description": "Sort model properties to place required parameters before optional parameters.",
"type": "boolean",
"optValue": null,
"default": "true",
"enum": null
},
"ensureUniqueParams": {
"opt": "ensureUniqueParams",
"description": "Whether to ensure parameter names are unique in an operation (rename parameters that are not).",
"type": "boolean",
"optValue": null,
"default": "true",
"enum": null
},
"allowUnicodeIdentifiers": {
"opt": "allowUnicodeIdentifiers",
"description": "boolean, toggles whether unicode identifiers are allowed in names or not, default is false",
"type": "boolean",
"optValue": null,
"default": "false",
"enum": null
},
"prependFormOrBodyParameters": {
"opt": "prependFormOrBodyParameters",
"description": "Add form or body parameters to the beginning of the parameter list.",
"type": "boolean",
"optValue": null,
"default": "false",
"enum": null
},
"legacyDiscriminatorBehavior": {
"opt": "legacyDiscriminatorBehavior",
"description": "Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).",
"type": "boolean",
"optValue": null,
"default": "true",
"enum": {
"true": "The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.",
"false": "The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing."
}
},
"disallowAdditionalPropertiesIfNotPresent": {
"opt": "disallowAdditionalPropertiesIfNotPresent",
"description": "If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.",
"type": "boolean",
"optValue": null,
"default": "true",
"enum": {
"false": "The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.",
"true": "Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default."
}
},
"enumUnknownDefaultCase": {
"opt": "enumUnknownDefaultCase",
"description": "If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.",
"type": "boolean",
"optValue": null,
"default": "false",
"enum": {
"false": "No changes to the enum's are made, this is the default option.",
"true": "With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case."
}
},
"hideGenerationTimestamp": {
"opt": "hideGenerationTimestamp",
"description": "Hides the generation timestamp when files are generated.",
"type": "string",
"optValue": null,
"default": "true",
"enum": null
},
"useJsonUnformatted": {
"opt": "useJsonUnformatted",
"description": "Use cJSON_PrintUnformatted instead of cJSON_Print when creating the JSON string.",
"type": "string",
"optValue": null,
"default": "false",
"enum": null
}
}
openapi-generator version
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure at https://api.openapi-generator.tech/api/gen/clients/c and inspect the handling of the sortParamsByRequiredFlag option in the returned configuration. The issue is resolved when the C client endpoint responds without the reported error and returns valid generator options.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, java, openapi
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100