Skip to content

C# convert special chars to enum #3500

Closed

Description

In Atlassian Open Api, there is an enum for queries and it contains some chars. C# generator converts lots of them correctly. However it does not convert 2 of them (~, ~=).

..."FieldValueClause":{
"required":["field","operand","operator"],
"type":"object",
"properties":{"field":{"$ref":"#/components/schemas/JqlQueryField"},
"operand":{"$ref":"#/components/schemas/JqlQueryClauseOperand"},
"operator":{"type":"string",
"description":"The operator between the field and operand.",
"enum":["=","!=",">","<",">=","<=","in","not in","~","~=","is","is not"]}},
"description":"A clause that asserts the current value of a field. For example, `summary ~ test`."}...

Generated client code is:

public enum FieldValueClause_operator {
        [EnumMember(Value = "=")]
        Equal,
        [EnumMember(Value = "!=")]
        ExclamationEqual,
        [EnumMember(Value = ">")]
        GreaterThan,
        [EnumMember(Value = "<")]
        LessThan,
        [EnumMember(Value = ">=")]
        GreaterThanEqual,
        [EnumMember(Value = "<=")]
        LessThanEqual,
        [EnumMember(Value = "in")]
        In,
        [EnumMember(Value = "not in")]
        NotIn,
        [EnumMember(Value = "~")]
        ~, //not valid
        [EnumMember(Value = "~=")]
        ~=, //not valid
        [EnumMember(Value = "is")]
        Is,
        [EnumMember(Value = "is not")]
        IsNot,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

WIPenhancementNew feature or requestgeneratorIssues or improvements relater to generation capabilities.

Type

No type

Projects

  • Status

    Done ✔️

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions