OpenAPITools / OpenAPITools/openapi-generator

[REQ] Ability to include data type in the generated asciidoctor file

Open
#8,051 1 comment 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.

Although data types can be defined on query parameters, there is no option to include the data type in the generated adoc. For example, I am using the PetStore sample as input (https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v2.0/json/petstore.json). The specific snippet that is relevant is

"parameters": [
{
"name": "limit",
"in": "query",
"description": "How many items to return at one time (max 100)",
"required": false,
"type": "integer",
"format": "int32"
}
],

Note the data type and format. To generate the output, I am running

java -jar openapi-generator-cli.jar generate -i "D:\petstore.json" -g asciidoc -o .

The relevant snippet of the generated adoc reads

====== Query Parameters

[cols="2,3,1,1,1"]
|===
|Name| Description| Required| Default| Pattern

| limit
| How many items to return at one time (max 100)
| -
| null
|

|===

Note the absence of any type information

Describe the solution you'd like

It would be nice if the adoc generator included a flag to include the data type / format. (It would also be nice to be able to exclude columns, such as Default and Pattern, but I suppose that should be a separate request.)

Thanks!

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 the asciidoc generator invoked by the shown openapi-generator-cli command and trace how query parameters from the PetStore input become the generated table. Add an option that includes each parameter's data type and format, then regenerate the sample output to verify the type information appears.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, documentation
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.