The values are salePrice and -salePrice.
It's is quite common that a dash is used to denote a reverse ordering.
The problem is that swagger_parser strips out the -
Using this did not help:
replacement_rules:
# Example of rule
- pattern: "-"
replacement: "reverse"
This is the generated enum
@JsonEnum()
enum O2 {
@JsonValue('-salePrice')
salePrice('-salePrice'), // <--Duplicate
@JsonValue('salePrice')
salePrice('salePrice'), // <--Duplicate
/// Default value for all unparsed values, allows backward compatibility when adding new values on the backend.
$unknown(null);
const O2(this.json);
factory O2.fromJson(String json) => values.firstWhere(
(e) => e.json == json,
orElse: () => $unknown,
);
final String? json;
}
I have an enum that has all the filtering options
The values are
salePrice
and-salePrice
. It's is quite common that a dash is used to denote a reverse ordering. The problem is thatswagger_parser
strips out the-
Using this did not help:This is the generated enum