Skip to content

Commit

Permalink
Merge pull request #7 from baywet/feature/reserved
Browse files Browse the repository at this point in the history
- adds reserved parameter extension
  • Loading branch information
darrelmiller authored Aug 25, 2023
2 parents b7982cf + c0d6dbf commit 1b4ea03
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 13 deletions.
19 changes: 10 additions & 9 deletions extensions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@

| Name | Purpose | Used By | Status |
|------|---------|---------|--------|
|[x-ms-client-flatten](https://github.com/Azure/autorest/blob/main/docs/extensions/readme.md#x-ms-client-flatten) | flattens client model property or parameter. |AutoRest| |
|[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-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| |
|[x-ms-odata](https://github.com/Azure/autorest/blob/main/docs/extensions/readme.md#x-ms-odata) | indicates the operation includes one or more [OData](http://www.odata.org/) query parameters. |AutoRest| |
|[x-ms-pageable](https://github.com/Azure/autorest/blob/main/docs/extensions/readme.md#x-ms-pageable) | allows paging through lists of data. |AutoRest||
|[x-ms-parameter-grouping](https://github.com/Azure/autorest/blob/main/docs/extensions/readme.md#x-ms-parameter-grouping) | groups method parameters in generated clients |AutoRest|
|[x-ms-parameter-location](https://github.com/Azure/autorest/blob/main/docs/extensions/readme.md#x-ms-parameter-location) | provides a mechanism to specify that the global parameter is actually a parameter on the operation and not a client property. |AutoRest|
|[x-ms-odata](https://github.com/Azure/autorest/blob/main/docs/extensions/readme.md#x-ms-odata) | indicates the operation includes one or more [OData](http://www.odata.org/) query parameters. |AutoRest|||
|[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-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-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-client-flatten](https://github.com/Azure/autorest/blob/main/docs/extensions/readme.md#x-ms-client-flatten) | flattens client model property or parameter. |AutoRest| |
|[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||
| [x-ms-deprecation](x-ms-deprecation.md)| Provides additional information about a deprecated endpoint, schema, property, etc... | Kiota |
|[x-ms-parameter-grouping](https://github.com/Azure/autorest/blob/main/docs/extensions/readme.md#x-ms-parameter-grouping) | groups method parameters in generated clients |AutoRest| |
|[x-ms-parameter-location](https://github.com/Azure/autorest/blob/main/docs/extensions/readme.md#x-ms-parameter-location) | provides a mechanism to specify that the global parameter is actually a parameter on the operation and not a client property. |AutoRest| |
|[x-ms-reserved-parameter](x-ms-reserved-parameter.md) | provides details on whether a path parameter should be reserved in an URI template or not | Kiota | |

## UI Extensions

Expand Down
2 changes: 1 addition & 1 deletion extensions/x-ms-deprecation.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ servers:
Used by: (informational)
* [Microsoft Kiota](https://microsoft.github.io/kiota)
* [Microsoft Kiota](https://aka.ms/kiota)
6 changes: 3 additions & 3 deletions extensions/x-ms-kiota-info.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenAPI Extension: x-ms-kiota-info

This extension enables API providers to annotation their OpenAPI descriptions to simplify the use of [Kiota](https://microsoft.github.io/kiota) tooling. By providing this information in the OpenAPI description it is not necessary for API consumers to provide these parameters when generating API client code. This allows the API provider to deliver a simple experience for developers to generate clients and can easily identify package dependencies that further enhance the experience with support for custom media types and authentication providers.
This extension enables API providers to annotation their OpenAPI descriptions to simplify the use of [Kiota](https://aka.ms/kiota) tooling. By providing this information in the OpenAPI description it is not necessary for API consumers to provide these parameters when generating API client code. This allows the API provider to deliver a simple experience for developers to generate clients and can easily identify package dependencies that further enhance the experience with support for custom media types and authentication providers.

## x-ms-kiota-info object

Expand All @@ -12,7 +12,7 @@ Properties are optional unless specified otherwise.

| name | type | description |
|---|---|---|
| languagesInformation | map[string,languageInformation] | Map of language information used to configure Kiota API client code generation. Only key values that match one of the values used in the Kiota `--language` [parameter](https://microsoft.github.io/kiota/using.html#--language--l) will be used by Kiota. Keys are matched case insensitive.|
| languagesInformation | map[string,languageInformation] | Map of language information used to configure Kiota API client code generation. Only key values that match one of the values used in the Kiota `--language` [parameter](https://learn.microsoft.com/en-us/openapi/kiota/using#--language--l) will be used by Kiota. Keys are matched case insensitive.|

## languageInformation Object

Expand Down Expand Up @@ -94,4 +94,4 @@ servers:
Used by: (informational)
* [Microsoft Kiota](https://microsoft.github.io/kiota)
* [Microsoft Kiota](https://aka.ms/kiota)
41 changes: 41 additions & 0 deletions extensions/x-ms-reserved-parameter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# OpenAPI Extension: x-ms-reserved-parameter

This extension enables OpenAPI to convey additional information about the path parameters.

## x-ms-reserved-parameter property

## Property

This extension is a boolean property that defines whether a path parameter should be converted to a [reserved expansion parameter](https://www.rfc-editor.org/rfc/rfc6570#section-3.2.3) or not when building a RFC 6570 URI Template from the servers/path/parameters.

## Schema

Below is a yaml representation of the JSON Schema that defines the shape of the `x-ms-reserved-parameter` property.

```yaml
type: boolean
```
## 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/{bar}
parameters:
- in: path
name: bar
type: string
required: true
x-ms-reserved-parameter: true
servers:
- url: https://graph.microsoft.com/v1.0
```
Used by: (informational)
* [Microsoft Kiota](https://aka.ms/kiota)

0 comments on commit 1b4ea03

Please sign in to comment.