swagger-api / swagger-api/swagger-core

@ArraySchema name does not override parameter name

Open
#4,423 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backlog
Dominant language
Java
Stars
7.5k
Forks
2.3k
Avg merge
18h 1m
Merged PRs (30d)
10

Description

This

@ArraySchema(arraySchema = @Schema(description = "Status of the receipt", name = "status", example = "paid"))
private List<ReceiptStatus> statuses;

results in a parameter of type array with name statuses.
As per the documentation (https://docs.swagger.io/swagger-core/v2.2.10/apidocs/io/swagger/v3/oas/annotations/media/ArraySchema.html#arraySchema()) my expectation was the property name to override the parameter name.

Tested with swagger-core 2.2.9, springdpc-openapi-securiy 1.7.0, swagger-annotations 2.2.10

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 by reproducing the shown @ArraySchema example with swagger-core and inspect how arraySchema() handles the nested @Schema name. Confirm the generated parameter currently uses statuses, then verify that the documented name override behavior is reflected in the generated OpenAPI output.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.