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
  • #1888
Closed
Open
Issue created Jan 11, 2019 by Administrator@rootContributor

[BUG] [Spring] Defining a schema called Resource leads in a wrong generated model using org.springframework.core.io.Resource instead

Created by: gerardbosch

Description

I am using openapi-generator version 3.3.0 as the openapi-generator-maven-plugin for Spring language.

If I define an OpenAPI schema called Resource, like the following,

    Resource:
      type: object
      properties:
        description:
          type: string
        grants:
          type: object
          additionalProperties:
            type: boolean
        id:
          type: string
        publicId:
          type: string
        publicIdType:
          type: string
          enum:
            - IBAN
            - BBAN
            - MSISDN
            - PAN

no Resource model class is genrated. And what I get is the following: the schemas that reference or contain the avobe Resource, what actually have is the following example:

  @JsonProperty("resources")
  @Valid
  private List<org.springframework.core.io.Resource> resources = new ArrayList<>();

So it looks like that instead of generating an object model called Resource it is using a Spring type called Resource.

I can only think this is a bug. Could someone confirm it?

Very happy with the generator by the way. Thanks!

openapi-generator version

3.3.0

OpenAPI declaration file content or url

A little fragment of the schema producing the issue:

    Resource:
      type: object
      properties:
        description:
          type: string
        grants:
          type: object
          additionalProperties:
            type: boolean
        id:
          type: string
        publicId:
          type: string
        publicIdType:
          type: string
          enum:
            - IBAN
            - BBAN
            - MSISDN
            - PAN
Command line used for generation

mvn clean install

Assignee
Assign to
Time tracking