OpenAPITools / OpenAPITools/openapi-generator

[REQ][Qt] Add allowReserved variable to mustache for operation parameter

Open
#8,564 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Is your feature request related to a problem? Please describe.

I am working on parameter styling support for the Qt code generator. I came across the problem that the allowReserved variable is missing in the template. I need this variable for the parameter encoding, because they are either percent encoded or not.

Describe the solution you'd like

I would like to be able to retrieve the allowReserved variable in mustache with {{allowReserved}}

Describe alternatives you've considered

There are no alternatives as long is I am aware.

Additional context

I was searching the project and came across the class org.openapitools.codegen.CodegenParamter that is missing the allowReserved variable while the class io.swagger.v3.oas.models.parameters.Parameter contains it.
A solution that might work is to change the AbstractCppCodegen.java on line 335f. and retrieve the variable from the OpenAPI Object and put it in additionalProperties but I am not sure if thats the way to go because I would put it on a global mustache level and not on the parameter of the according operation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with org.openapitools.codegen.CodegenParamter and compare it with io.swagger.v3.oas.models.parameters.Parameter, then inspect AbstractCppCodegen.java around line 335. Trace how operation-parameter values reach the Qt mustache template and whether the value is scoped to that parameter rather than global additionalProperties. Done means Qt templates can retrieve allowReserved as {{allowReserved}} for parameter encoding.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, java
Domain
devtools, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.