Skip to content

Commit cb97e6a

Browse files
committed
Address PR Review comments
1 parent 3b31249 commit cb97e6a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

aspnetcore/fundamentals/openapi/include-metadata.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,14 @@ public enum DayOfTheWeekAsString
521521
}
522522
```
523523
524-
A special case is when an enum type has the [Flags] attribute, which indicates that the enum can be treated as a bit field; that is, a set of flags. A flags enums with a [JsonConverterAttribute] will be defined as `type: string` in the generated schema with no `enum` property, since the value could be any combination of the enum values.
524+
A special case is when an enum type has the [Flags] attribute, which indicates that the enum can be treated as a bit field; that is, a set of flags. A flags enum with a [JsonConverterAttribute] will be defined as `type: string` in the generated schema with no `enum` property, since the value could be any combination of the enum values. For example, the following enum:
525+
526+
```csharp
527+
[Flags, JsonConverter(typeof(JsonStringEnumConverter<PizzaToppings>))]
528+
public enum PizzaToppings { Pepperoni = 1, Sausage = 2, Mushrooms = 4, Anchovies = 8 }
529+
```
530+
531+
could have values such as `"Pepperoni, Sausage"` or `"Sausage, Mushrooms, Anchovies"`.
525532
526533
An enum type without a [`[JsonConverter]`](xref:System.Text.Json.Serialization.JsonConverterAttribute) will be defined as `type: integer` in the generated schema.
527534

0 commit comments

Comments
 (0)