-
Notifications
You must be signed in to change notification settings - Fork 739
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Openapi to Typespec] Detect Arm and Fix unsupported char type (#4989)
* Currently SchemaType.Char is unsupported, mapping it to string to fix the problem * Automatically detect when a swagger is ARM Fixes #4991
- Loading branch information
Showing
11 changed files
with
8,299 additions
and
4 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
.../changes/@autorest/openapi-to-typespec/openapi-to-typespec-fix-char_2024-07-12-19-46.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@autorest/openapi-to-typespec", | ||
"comment": "Support char type from swagger and Automatically detect ARM specs", | ||
"type": "minor" | ||
} | ||
], | ||
"packageName": "@autorest/openapi-to-typespec" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/extensions/openapi-to-typespec/test/search/readme.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
```yaml | ||
library-name: Search | ||
namespace: Azure.Search | ||
isAzureSpec: true | ||
require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/search/data-plane/Azure.Search/readme.md | ||
#tag: package-preview-2023-06 | ||
modelerfour: | ||
flatten-payloads: false | ||
deserialize-null-collection-as-null-value: true | ||
``` |
45 changes: 45 additions & 0 deletions
45
packages/extensions/openapi-to-typespec/test/search/tsp-output/main.tsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* PLEASE DO NOT REMOVE - USED FOR CONVERTER METRICS | ||
* Generated by package: @autorest/openapi-to-typespec | ||
* Version: Not generated in test | ||
* Date: Not generated in test | ||
*/ | ||
import "@typespec/rest"; | ||
import "@typespec/http"; | ||
import "./routes.tsp"; | ||
|
||
using TypeSpec.Rest; | ||
using TypeSpec.Http; | ||
using TypeSpec.Versioning; | ||
/** | ||
* Client that can be used to manage and query indexes and documents, as well as | ||
* manage other resources, on a search service. | ||
*/ | ||
@service({ | ||
title: "SearchClient", | ||
}) | ||
@versioned(Versions) | ||
@server( | ||
"{endpoint}", | ||
"Client that can be used to manage and query indexes and documents, as well as manage other resources, on a search service.", | ||
{ | ||
/** | ||
* The name of the index. | ||
*/ | ||
indexName: string, | ||
|
||
endpoint: string, | ||
} | ||
) | ||
namespace Azure.Search; | ||
|
||
/** | ||
* The available API versions. | ||
*/ | ||
enum Versions { | ||
/** | ||
* The 2024-07-01 API version. | ||
*/ | ||
@useDependency(Azure.Core.Versions.v1_0_Preview_1) | ||
v2024_07_01: "2024-07-01", | ||
} |
Oops, something went wrong.