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
  • #275
Closed
Open
Issue created Jun 10, 2018 by Administrator@rootContributor

[aspnetcore] new keyword on ToJson Method when inherited from Dictionary

Created by: etherealjoy

Description

When a model is a map type and inherited from a dictionary the new keyword is added to ToJson method even when there is no accessible member to hide/override.

public partial class ResourceOperations : Dictionary<String, string>, 
    IEquatable<ResourceOperations>
{ 
    public  new string ToJson()
Warning	CS0109	The member 'ResourceOperations.ToJson()' does not hide an accessible member. 
The new keyword is not required.	
openapi-generator version

3.0.0

I detected this issue with old codebase. In current code base the map is not working.

OpenAPI declaration file content or url
  ResourceOperations:
    description: "An object describing the operations"
    type: "object"
    additionalProperties:
      type: "string"
Command line used for generation
java -jar ~/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar \
generate -i ./api.yaml -o ./genserver -l aspnetcore 
Suggest a fix/enhancement
Assignee
Assign to
Time tracking