Skip to content

Commit

Permalink
update attestation swagger (#6655)
Browse files Browse the repository at this point in the history
* update attestation swagger

* Move attestation API under a preview folder

* fix the error response

* remove the pattern validation from swaggle since the validation already appears on the server
  • Loading branch information
shleiAmy authored and mmyyrroonn committed Jul 18, 2019
1 parent e7849ce commit 5f7b83b
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
}
},
"default": {
"description": "Attestation service error result",
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorResult"
"$ref": "#/definitions/CloudError"
}
}
}
Expand All @@ -77,17 +77,16 @@
},
"parameters": [
{
"$ref": "#/parameters/SubscriptionIdParameter"
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceGroupNameParameter"
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter"
},
{
"name": "providerName",
"in": "path",
"required": true,
"type": "string",
"pattern": "^[a-z0-9]{3,24}$",
"description": "Name of the attestation service instance"
},
{
Expand All @@ -104,7 +103,7 @@
"default": {
"description": "Error result from Attestation service",
"schema": {
"$ref": "#/definitions/ErrorResult"
"$ref": "#/definitions/CloudError"
}
}
}
Expand All @@ -122,17 +121,16 @@
},
"parameters": [
{
"$ref": "#/parameters/SubscriptionIdParameter"
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceGroupNameParameter"
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter"
},
{
"name": "providerName",
"in": "path",
"required": true,
"type": "string",
"pattern": "^[a-zA-Z0-9-]{3,24}$",
"description": "Name of the attestation service"
},
{
Expand Down Expand Up @@ -164,7 +162,7 @@
"default": {
"description": "Error result from Attestation service",
"schema": {
"$ref": "#/definitions/ErrorResult"
"$ref": "#/definitions/CloudError"
}
}
}
Expand All @@ -182,37 +180,36 @@
},
"parameters": [
{
"$ref": "#/parameters/SubscriptionIdParameter"
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceGroupNameParameter"
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter"
},
{
"name": "providerName",
"in": "path",
"required": true,
"type": "string",
"pattern": "^[a-zA-Z0-9-]{3,24}$",
"description": "Name of the attestation service"
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"202": {
"description": "Request accepted for deletion of attestation service"
},
"200": {
"description": "Resource exists and was deleted successfully"
},
"202": {
"description": "Request accepted for deletion of attestation service"
},
"204": {
"description": "Resource does not exist"
},
"default": {
"description": "Error result from Attestation service",
"schema": {
"$ref": "#/definitions/ErrorResult"
"$ref": "#/definitions/CloudError"
}
}
}
Expand All @@ -235,7 +232,7 @@
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter"
}
],
"x-ms-pageable": {
Expand All @@ -251,7 +248,7 @@
"default": {
"description": "Attestation service error result",
"schema": {
"$ref": "#/definitions/ErrorResult"
"$ref": "#/definitions/CloudError"
}
}
}
Expand All @@ -271,13 +268,13 @@
},
"parameters": [
{
"$ref": "#/parameters/ResourceGroupNameParameter"
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter"
}
],
"x-ms-pageable": {
Expand All @@ -294,7 +291,7 @@
"default": {
"description": "Attestation service error result",
"schema": {
"$ref": "#/definitions/ErrorResult"
"$ref": "#/definitions/CloudError"
}
}
}
Expand Down Expand Up @@ -357,7 +354,7 @@
],
"allOf": [
{
"$ref": "../../../../common-types/resource-management/v1/types.json#/definitions/Resource"
"$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/Resource"
}
],
"properties": {
Expand Down Expand Up @@ -395,56 +392,28 @@
}
}
},
"ErrorResult": {
"type": "object",
"title": "Error",
"description": "Error description and code explaining why an operation failed.",
"CloudError": {
"x-ms-external": true,
"properties": {
"error": {
"type": "object",
"description": "Error object.",
"$ref": "#/definitions/ErrorResponseBody"
"$ref": "#/definitions/CloudErrorBody"
}
}
},
"description": "An error response from Attestation."
},
"ErrorResponseBody": {
"type": "object",
"title": "Error",
"description": "Error description and code explaining why an operation failed.",
"required": [
"message",
"code"
],
"CloudErrorBody": {
"x-ms-external": true,
"properties": {
"message": {
"code": {
"type": "string",
"description": "Description of the error."
"description": "An identifier for the error. Codes are invariant and are intended to be consumed programmatically."
},
"code": {
"message": {
"type": "string",
"description": "Service specific error code"
"description": "A message describing the error, intended to be suitable for displaying in a user interface."
}
}
},
"ErrorResponse": {
"type": "object",
"description": "Error response",
"properties": {
"error": {
"type": "object",
"description": "Error response",
"properties": {
"code": {
"type": "string",
"description": "Description of the error."
},
"message": {
"type": "string",
"description": "Service specific error code."
}
}
}
}
},
"description": "An error response from Attestation."
},
"AttestationProviderListResult": {
"description": "Attestation Providers List.",
Expand All @@ -469,24 +438,6 @@
}
},
"parameters": {
"ResourceGroupNameParameter": {
"name": "resourceGroupName",
"in": "path",
"description": "Name of the resource group to which the resource belongs.",
"required": true,
"type": "string",
"maxLength": 90,
"minLength": 1,
"pattern": "^[-\\w\\._\\(\\)]+[^\\.]$",
"x-ms-parameter-location": "method"
},
"SubscriptionIdParameter": {
"name": "subscriptionId",
"in": "path",
"required": true,
"type": "string",
"description": "Subscription credentials that uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."
},
"ApiVersionParameter": {
"name": "api-version",
"in": "query",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"serviceName": "sampleservicename",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"api-version": "2018-09-01-preview",
"providerName": "providerName1",
"providerName": "providername1",
"creationParams": "test"
},
"responses": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"serviceName": "sampleservicename",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"api-version": "2018-09-01-preview",
"providerName": "providerName1"
"providerName": "providername1"
},
"responses": {
"202": {
Expand Down
10 changes: 5 additions & 5 deletions specification/attestation/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ These are the global settings for the Attestation API.

``` yaml
openapi-type: arm
tag: package-2018-09
tag: package-2018-09-preview
```
### Tag: package-2018-09
### Tag: package-2018-09-preview
These settings apply only when `--tag=package-2018-09` is specified on the command line.
These settings apply only when `--tag=package-2018-09-preview` is specified on the command line.

``` yaml $(tag) == 'package-2018-09'
``` yaml $(tag) == 'package-2018-09-preview'
input-file:
- Microsoft.Attestation/2018-09-01-preview/attestation.json
- Microsoft.Attestation/preview/2018-09-01-preview/attestation.json
```

---
Expand Down

0 comments on commit 5f7b83b

Please sign in to comment.