diff --git a/extensions/index.md b/extensions/index.md index 10a7b176..e4c5cf3a 100644 --- a/extensions/index.md +++ b/extensions/index.md @@ -8,6 +8,7 @@ |[x-ms-client-name](https://github.com/Azure/autorest/blob/main/docs/extensions/readme.md#x-ms-client-name) | allows control over identifier names used in client-side code generation for parameters and schema properties. |AutoRest| | |[x-ms-code-generation-settings](https://github.com/Azure/autorest/blob/main/docs/extensions/readme.md#x-ms-code-generation-settings) | enables passing code generation settings via OpenAPI document |Autorest| | |[x-ms-deprecation](x-ms-deprecation.md)| Provides additional information about a deprecated endpoint, schema, property, etc... | Kiota | | +|[x-ms-enum-flags](x-ms-enum-flags.md)| Provides information about whether an enum is bitwise(flagged) and the expected serialization format | Kiota | | |[x-ms-external](https://github.com/Azure/autorest/blob/main/docs/extensions/readme.md#x-ms-external) | allows specific Definition Objects to be excluded from code generation |AutoRest| | |[x-ms-info-kiota](x-kiota-info.md)| Provides configuration information to the Kiota API client code generator| Kiota | |[x-ms-mutability](https://github.com/Azure/autorest/blob/main/docs/extensions/readme.md#x-ms-mutability) | provides insight to Autorest on how to generate code. It doesn't alter the modeling of what is actually sent on the wire. |AutoRest| | diff --git a/extensions/x-ms-enum-flags.md b/extensions/x-ms-enum-flags.md new file mode 100644 index 00000000..f65852d7 --- /dev/null +++ b/extensions/x-ms-enum-flags.md @@ -0,0 +1,56 @@ +# OpenAPI Extension: x-ms-enums-flags + +This extension enables API providers to specify an enum as a bitwise(flagged) enum as well as the format of serialization of the multiple selected values. + +## x-ms-enums-flags object + +### Properties + +Properties are optional unless specified otherwise. + +| name | type | description | +|---|---|---| +| isFlags | boolean | Whether or not the enum is bitwise(flagged). Default is `false`(same as not specifying the extension) | + +## Schema + +Below is a yaml representation of the JSON Schema that defines the shape of the `x-ms-deprecation` object. + +```yaml +type: object +properties: + isFlags: + type: boolean + default: false +``` + +## Example + +```yaml +openapi: 3.0.3 +info: + title: OData Service for namespace microsoft.graph + description: This OData service is located at https://graph.microsoft.com/v1.0 + version: 1.0.1 +paths: + '/foo' + operations: + get: +servers: + - url: https://graph.microsoft.com/v1.0 +definitions: + Microsoft.Graph.Feature: + title: Feature + enum: + - Feature1 + - Feature2 + - Feature3 + - Feature4 + type: string + x-ms-enum-flags: + isFlags: true +``` + +Used by: (informational) + +* [Microsoft Kiota](https://aka.ms/kiota)