Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #3808
Closed
Open
Issue created Aug 30, 2019 by Administrator@rootContributor4 of 6 checklist items completed4/6 checklist items

[BUG] [JAVA] Generic type generates invalid equals body

Created by: lsuski

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

I have spec generated from springfox with definition with name SomeObject«SomeNestedObject» and it generates equals method of this object containing this line

SomeObjectSomeNestedObject someObject«SomeNestedObject» = (SomeObjectSomeNestedObject) o;

which cannot compile because of «» characters

openapi-generator version

4.1.1

OpenAPI declaration file content or url
{
  "swagger": "2.0",
  "info": {
    "title": "Test"
  },
  "host": "com.test",
  "basePath": "/",
  "paths": {
    "/api/test/v1": {
      "get": {
        "operationId": "getUsingGET_1",
        "produces": [
          "*/*"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/SomeObject«SomeNestedObject»"
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "definitions": {
    "SomeObject«SomeNestedObject»": {
      "type": "object",
      "properties": {
        "id": {
          "description": "id",
          "type": "string"
        }
      },
      "title": "SomeObject«SomeNestedObject»"
    }
  }
}
Command line used for generation

I'm using org.openapitools:openapi-generator-gradle-plugin:4.1.1

gradlew openApiGenerate

build.gradle

openApiGenerate {
    generatorName = 'java'
    library = 'retrofit2'
    configOptions = [
         dateLibrary: "legacy",
        supportJava6: "true",
        parcelableModel: 'true'
    ]
}
Related issues/PRs

https://github.com/OpenAPITools/openapi-generator/pull/1157

Assignee
Assign to
Time tracking