Skip to content

[BUG] [csharp-functions] Generator does not apply optionalEmitDefaultValues parameter #21615

@mehmetbilen2

Description

@mehmetbilen2

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Running csharp-functions server generator generates model properties with [EmitDefaultValue=false)] attribute even though with passing optionalEmitDefaultValues=trueparameter. This is working with aspnetcore server generator but does not apply csharp-functions generator.

Image
openapi-generator version

7.14.0

OpenAPI declaration file content or url

can be reproduced with the petstore file

Generation Details

openapi-generator-cli generate -i <file path> -g csharp-functions --additional-properties=optionalEmitDefaultValues=true

Steps to reproduce

run the command above

Related issues/PRs

This PR fixed the issue for aspnetcore generator but csharp-functions ramained buggy.
#4010

Suggest a fix

Apply same fix from #4010

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions