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
  • #4789
Closed
Open
Issue created Dec 13, 2019 by Administrator@rootContributor4 of 5 checklist items completed4/5 checklist items

[BUG] Inheritance and Maps canno coexist

Created by: maxper75

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?
Description

The attached file represents an inheritance containing, in the subclass, a hashmap with a custom type. Well, I don't get this, but I get different results. As a result I'd expect to get

public class SubObjectDTO extends SuperObjectDTO {
private Map<String, MapElementDTO> additionalMap;
....[getters and setter and whatever more]---
}
public class SuperObjectDTO {
private UUID id;
private String superProperty1;
private String superProperty2;
....[getters and setter and whatever more]---
}

public class MapElementDTO {
private int property1;
private boolean property2;
private String property3;
....[getters and setter and whatever more]---
}

while I get the Super class and the map element ok, the subclass varies depending from the inclusion of the clause of allOf. If I add this, I see the element with the properties of the superclass, but no additionalProperties. If i remove this, I dont get the super class props but just the additional ones. Is this a bug or I'm doing a mistake?

openapi-generator version

openapi-generator version 4.2.2

OpenAPI declaration file content or url

See attached gist https://gist.github.com/maxper75/62a7cdac09037679641c56f552bc21ef#file-buggy-openapi-inheritance-map-json

Command line used for generation

openapi-generator generate -g spring -i model.json -o prova

Steps to reproduce

just launch the command :D

Assignee
Assign to
Time tracking