Skip to content

[BUG] C# Generator with component name "on" produces in correct datamember #13609

@EricAtORS

Description

@EricAtORS

Bug Report Checklist

  • [x ] Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • 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?
    Actual:
        [DataMember(Name="true", EmitDefaultValue=false)]

Expected:

        [DataMember(Name="on", EmitDefaultValue=false)]
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

I created a schema component for which one of the propties is called on. Somewhere in the generation step, the value on gets lost is translated to true

openapi-generator version

I'm using version 6.2.0
It's a regression. It used to work in version 5.x.x

OpenAPI declaration file content or url
openapi: 3.0.0
info:
  version: 0.0.1
  title: Test

  
paths:
  /:
    get:
      summary: get test
      responses:
        '200':
          description: OK

servers:
  - url: http://localhost:81

components:
  schemas:
    Effect:
        properties:
          on:
            description: If true, turns on the visual effect. If false, turn off the visual effect.
            type: boolean
Generation Details
Steps to reproduce
  1. save the yml file as example.yml
  2. Run: openapi-generator-cli generate -g csharp -i ./file.yml -o client
Related issues/PRs
Suggest a fix

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions