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
  • #11415
Closed
Open
Issue created Jan 26, 2022 by Administrator@rootContributor

[aspnetcore] Setting properties of a model in server that are readOnly for client

Created by: HOTAPIYC

Description

I am working on a project that uses a generated C# ASP.NET core server-stub. The project is on .NET 6. There are a number of parameters in the API that are specified as readOnly: true for the client. However on the serverside I do want to write these fields. The model template assigns these parameters a private set. How am I supposed to write in this case? There is also no constructor.

openapi-generator version

v5.1.0

Suggest a fix/enhancement

Temporary solution to this problem is to customize the template and remove the private attribute. I would prefer however not to do this and use the defaults instead. Is this a potential bug or am I missing something here?

Assignee
Assign to
Time tracking