Skip to content

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

@HOTAPIYC

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions