OpenAPITools / OpenAPITools/openapi-generator

[REQ] Better collection serialization support

Open
#4,039 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.

Since OAS 3.0, in order to support common ways of serializing simple parameters, style and explode are defined instead of collectionFormat.

On the other hand, we still using collectionFormat: style and explode parameters are mapped to collectionFormat.

https://github.com/OpenAPITools/openapi-generator/blob/7dbda049f09edd40662cfc0d00a3bc6e52b257eb/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java#L3083-L3094

https://github.com/OpenAPITools/openapi-generator/blob/7dbda049f09edd40662cfc0d00a3bc6e52b257eb/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java#L4592-L4609

This can not representate serialization format required in OAS3.

Describe the solution you'd like

In order to make available the serialization format, explode and style parameter values should be assigned to mustache templates, and handle the parameters in each generator.

We need to keep collectionFormat until generators support style and explode.

Additional context

Related PR: https://github.com/OpenAPITools/openapi-generator/pull/3984

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 in modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java at the referenced lines, and review the related PR 3984. Trace how style and explode are currently mapped to collectionFormat, then inspect the mustache-template handoff and generator-specific handling. Done means OAS3 serialization values are available without removing collectionFormat compatibility.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.