-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check Resource Name added to swagger #9185
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
b997c58
Check Resource Name added to swagger
6a54977
spellcheck and prettier check fixed
32185d6
fixes
72ae4be
prettier check and x-ms fixes
ca6bea7
added schema for resource name
fbbfff9
fixes
7437670
description added to resourcename
3be4944
added changes to all api versions
cbbdd6d
default response added
0697c03
prettier checl
4d1f991
default response changed
ad5ed34
removed 2016-06-01 api
16806d9
override errors
3fdd3be
file moved to examples
777b40b
single override
7df8056
reverting
4f88bac
override policyclient
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
...es/resource-manager/Microsoft.Resources/stable/2015-11-01/examples/CheckResourceName.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,20 @@ | ||
{ | ||
"parameters": { | ||
"body": [ | ||
{ | ||
"Name": "isxbox", | ||
"Type": "ResourceProviderTestHost/TestResourceType" | ||
} | ||
], | ||
"api-version": "2015-11-01" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"name": "isxbox", | ||
"type": "ResourceProviderTestHost/TestResourceType", | ||
"status": "Allowed" | ||
} | ||
} | ||
} | ||
} |
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
20 changes: 20 additions & 0 deletions
20
...es/resource-manager/Microsoft.Resources/stable/2016-06-01/examples/CheckResourceName.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,20 @@ | ||
{ | ||
"parameters": { | ||
"body": [ | ||
{ | ||
"Name": "isxbox", | ||
"Type": "ResourceProviderTestHost/TestResourceType" | ||
} | ||
], | ||
"api-version": "2016-06-01" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"name": "isxbox", | ||
"type": "ResourceProviderTestHost/TestResourceType", | ||
"status": "Allowed" | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -162,6 +162,46 @@ | |
"nextLinkName": "nextLink" | ||
} | ||
} | ||
}, | ||
"/providers/Microsoft.Resources/checkResourceName": { | ||
"post": { | ||
"tags": [ | ||
"Tenants" | ||
], | ||
"operationId": "checkResourceName", | ||
"description": "A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with a reserved word", | ||
"summary": "Checks resource name validity", | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"parameters": [ | ||
{ | ||
"$ref": "#/parameters/CheckResourceNameParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ApiVersionParameter" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing default response |
||
"description": "OK - Returns status as allowed or not.", | ||
"schema": { | ||
"$ref": "#/definitions/CheckResourceNameResult" | ||
} | ||
}, | ||
"default": { | ||
"description": "Error response saying resource name is invalid", | ||
"schema": { | ||
"$ref": "#/definitions/ErrorResponse" | ||
} | ||
} | ||
}, | ||
"x-ms-examples": { | ||
"Check validity for a resource name.": { | ||
"$ref": "./examples/CheckResourceName.json" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
|
@@ -338,6 +378,70 @@ | |
], | ||
"description": "Tenant Ids information." | ||
}, | ||
"ResourceName": { | ||
"description": "Name and Type of the Resource", | ||
"required": [ | ||
"name", | ||
"type" | ||
], | ||
"properties": { | ||
"name": { | ||
"description": "Name of the resource", | ||
"type": "string" | ||
}, | ||
"type": { | ||
"type": "string", | ||
"description": "The type of the resource" | ||
} | ||
} | ||
}, | ||
"CheckResourceNameResult": { | ||
"properties": { | ||
"name": { | ||
"description": "Name of Resource", | ||
"type": "string" | ||
}, | ||
"type": { | ||
"description": "Type of Resource", | ||
"type": "string" | ||
}, | ||
"status": { | ||
"description": "Is the resource name Allowed or Reserved", | ||
"type": "string", | ||
"enum": [ | ||
"Allowed", | ||
"Reserved" | ||
], | ||
"x-ms-enum": { | ||
"name": "ResourceNameStatus", | ||
"modelAsString": true | ||
} | ||
} | ||
}, | ||
"description": "Resource Name valid if not a reserved word, does not contain a reserved word and does not start with a reserved word" | ||
}, | ||
"ErrorResponse": { | ||
"description": "Error response.", | ||
"properties": { | ||
"error": { | ||
"$ref": "#/definitions/ErrorDefinition", | ||
"description": "The error details." | ||
} | ||
} | ||
}, | ||
"ErrorDefinition": { | ||
"description": "Error description and code explaining why resource name is invalid.", | ||
"properties": { | ||
"message": { | ||
"type": "string", | ||
"description": "Description of the error." | ||
}, | ||
"code": { | ||
"type": "string", | ||
"description": "Code of the error." | ||
} | ||
} | ||
}, | ||
"Operation": { | ||
"description": "Microsoft.Resources operation", | ||
"type": "object", | ||
|
@@ -395,6 +499,15 @@ | |
"description": "The ID of the target subscription.", | ||
"x-ms-parameter-location": "method" | ||
}, | ||
"CheckResourceNameParameter": { | ||
"description": "Resource object with values for resource name and resource type", | ||
"in": "body", | ||
"name": "Resource Name Definition", | ||
"schema": { | ||
"$ref": "#/definitions/ResourceName" | ||
}, | ||
"x-ms-parameter-location": "method" | ||
}, | ||
"ApiVersionParameter": { | ||
"name": "api-version", | ||
"in": "query", | ||
|
20 changes: 20 additions & 0 deletions
20
...es/resource-manager/Microsoft.Resources/stable/2018-06-01/examples/CheckResourceName.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,20 @@ | ||
{ | ||
"parameters": { | ||
"body": [ | ||
{ | ||
"Name": "isxbox", | ||
"Type": "ResourceProviderTestHost/TestResourceType" | ||
} | ||
], | ||
"api-version": "2018-06-01" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"name": "isxbox", | ||
"type": "ResourceProviderTestHost/TestResourceType", | ||
"status": "Allowed" | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing "default" response