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
  • #2285
Closed
Open
Issue created Mar 03, 2019 by Jim Schubert@jimschubertContributor

[aspnetcore] Minor cleanups to library-based output

Description

Some minor issues found during verification of #2282, but can be fixed after merge of that PR:

  • generating as buildTarget=library omits Dockerfile, but does not remove docker build steps from README.md
  • When specifying classModifier=abstract and method body is omitted, semicolon is below the abstract method signature, and should be on the same line
  • I think this was mentioned in the original PR: wwwroot shouldn't be generated for library options (or should it? I don't think it makes sense, and I don't know if aspnet allows pulling wwwroot from a dependency).

Additional TODOs for the library-based generated output:

  • make class and operation modifiers enums on CLI input

  • validate combinations of modifiers (class + operation), and disallow any which shouldn't be allowed by the language (such as disallowing partial methods, which can't be virtual and can't be applied to non-void methods-- we return IActionResult)

  • README should explain how to use the generated code, as it may not be immediately obvious to some users. Example of ConfigureServices in Startup.cs:

             services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2)
                 .AddApplicationPart(typeof(PetApiController).Assembly)
                 .AddControllersAsServices();

    Note: users installing new dotnet SDK(at least on Mac with Rider) can only generate .NETCore 2.2 and need to upgrade the project for the above to work. The above should work for .NETCore 2.1 by removing .SetCompatibilityVersion(CompatibilityVersion.Version_2_2)

openapi-generator version

n/a

OpenAPI declaration file content or url

n/a

Command line used for generation

n/a

Steps to reproduce
Related issues/PRs

#2282

Suggest a fix/enhancement

n/a

Assignee
Assign to
Time tracking