OpenAPITools / OpenAPITools/openapi-generator
[BUG] Merging referenced parameter does not work in 3.1.0
Nobody has claimed this yet.
- 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
The parameters of a path item and an operation object do not get merged if the spec version is 3.1.0 and they both contain a referenced parameter.
openapi-generator version
7.7.0
OpenAPI declaration file content or url
openapi: 3.1.0
info:
title: Open API
version: 1.0.0
paths:
/{path}:
parameters:
- $ref: "#/components/parameters/path"
get:
parameters:
- $ref: "#/components/parameters/query"
summary: Returns a list of users.
responses:
200:
description: get something
content:
application/json:
schema:
type: string
components:
parameters:
path:
name: path
in: path
required: true
schema:
type: string
query:
name: query
in: query
required: false
schema:
type: string
Generation Details
I have tried a handful of generators with their default configs and each time the path parameter was missing in the generated output while the query parameter was present. Going back to version 3.0.2, only using one parameters array or inlining the parameters all fix the problem.
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 issue with the inline OpenAPI 3.1.0 YAML and the default generators described in the report, comparing output with versions 7.7.0 and 3.0.2. Done means the generated output retains both the referenced path parameter and the operation's referenced query parameter when the path item and operation parameter arrays are merged.
Written by the indexing model from the issue text.
Assessment
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100