forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…re#1122) * Fixes Azure#881 - failure to accept x-* vendor extension in path * fixed code analysis issue * code analysis again
- Loading branch information
1 parent
cd47ac1
commit 81ba78c
Showing
4 changed files
with
89 additions
and
1 deletion.
There are no files selected for viewing
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
47 changes: 47 additions & 0 deletions
47
AutoRest/Modelers/Swagger.Tests/Swagger/vendor-extension-in-path.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,47 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"version": "2.0", | ||
"title": "My web service", | ||
"description": "No description provided.", | ||
"x-endpoint-name": "default" | ||
}, | ||
"host": "dsw12.net:999", | ||
"basePath": "/sandbox/8c88389038102937482abf83f8f/services/5b737fefc19b3047ab4f3234cd34642df2", | ||
"schemes": [ | ||
"https" | ||
], | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"paths": { | ||
"/swagger.json": { | ||
"get": { | ||
"summary": "Get swagger API document for the web service", | ||
"operationId": "getSwaggerDocument", | ||
"parameters": [ | ||
{ | ||
"name": "api-version", | ||
"in": "query", | ||
"description": "API version", | ||
"required": false, | ||
"type": "string", | ||
"default": "2.0", | ||
"enum": [ | ||
"2.0" | ||
] | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Swagger API document for this service" | ||
} | ||
} | ||
} | ||
}, | ||
"x-vendor-testy": "asd" | ||
} | ||
} |
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,30 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
using System.IO; | ||
using Microsoft.Rest.Generator; | ||
using Xunit; | ||
|
||
namespace Microsoft.Rest.Modeler.Swagger.Tests | ||
{ | ||
[Collection("AutoRest Tests")] | ||
public class VendorExtensionInPath | ||
{ | ||
[Fact] | ||
public void AllowVendorExtensionInPath() | ||
{ | ||
SwaggerModeler modeler = new SwaggerModeler(new Settings | ||
{ | ||
Namespace = "Test", | ||
Input = Path.Combine("Swagger", "vendor-extension-in-path.json") | ||
}); | ||
var clientModel = modeler.Build(); | ||
|
||
// should return a valid model. | ||
Assert.NotNull(clientModel); | ||
|
||
// there should be one method in this generated api. | ||
Assert.Equal(1, modeler.ServiceClient.Methods.Count); | ||
} | ||
} | ||
} |
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