swagger-api / swagger-api/swagger-codegen

[Java] Generate copy constructor in models

Open
#3,883 6 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Java Enhancement: General help wanted
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Java models should have a way to easily create a clone or copy. Cloneable seems like a bad idea so I think we're probably left with a copy function or copy constructor.

I couldn't find anything in issues search. Has this been suggested before?

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

The issue concerns generated Java models but names no files, tests, or entry points. Start by locating the Java model generation templates and define the expected copy-constructor behavior; done means generated models consistently support the agreed cloning or copying approach.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.