Skip to content

Commit

Permalink
Fix readme and discriminator model validation error
Browse files Browse the repository at this point in the history
  • Loading branch information
victoriachenm committed Jun 17, 2022
1 parent e52ff83 commit 2a4ce96
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 101 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"name": "branch1",
"actions": [
{
"type": "Continuous",
"type": "continuous",
"name": "urn:csci:provider:providername:Shutdown/1.0",
"selectorId": "selector1",
"duration": "PT10M",
Expand Down Expand Up @@ -68,7 +68,7 @@
"name": "branch1",
"actions": [
{
"type": "Continuous",
"type": "continuous",
"name": "urn:csci:provider:providername:Shutdown/1.0",
"selectorId": "selector1",
"duration": "PT10M",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type": "Microsoft.Chaos/locations/targetTypes/capabilityTypes",
"name": "Shutdown-1.0",
"properties": {
"kind": "Fault",
"kind": "fault",
"publisher": "Microsoft",
"targetType": "VirtualMachine",
"displayName": "Shutdown VM",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"name": "branch1",
"actions": [
{
"type": "Continuous",
"type": "continuous",
"name": "urn:csci:provider:providername:Shutdown/1.0",
"selectorId": "selector1",
"duration": "PT10M",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type": "Microsoft.Chaos/experiments/executionDetails",
"id": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment/executionDetails/f24500ad-744e-4a26-864b-b76199eac333",
"name": "f24500ad-744e-4a26-864b-b76199eac333",
"properites": {
"properties": {
"createdDateTime": "2020-12-14T21:52:42.917983Z",
"lastActionDateTime": "2020-12-14T21:52:52.2552574Z",
"startDateTime": "2020-12-14T21:52:52.2552574Z",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "Microsoft.Chaos/locations/targetTypes/capabilityTypes",
"name": "Shutdown-1.0",
"properties": {
"kind": "Fault",
"kind": "fault",
"publisher": "Microsoft",
"targetType": "VirtualMachine",
"displayName": "Shutdown VM",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"name": "branch1",
"actions": [
{
"type": "Continuous",
"type": "continuous",
"name": "urn:csci:provider:providername:Shutdown/1.0",
"selectorId": "selector1",
"duration": "PT10M",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"name": "branch1",
"actions": [
{
"type": "Continuous",
"type": "continuous",
"name": "urn:csci:provider:providername:Shutdown/1.0",
"selectorId": "selector1",
"duration": "PT10M",
Expand Down
131 changes: 38 additions & 93 deletions specification/chaos/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ For other options on installation see [Installing AutoRest](https://aka.ms/autor
These are the global settings for the chaos.

```yaml
title: ChaosManagementClient
description: Chaos Management Client
openapi-type: arm
tag: package-2022-07-01-preview
```
Expand All @@ -39,21 +41,14 @@ directive:
reason: Patch is not implemented in this version.
where:
- $.definitions.experiment
- suppress: R4017
reason: Proxy resource is not discoverable at the subscription level.
where:
- $.definitions.target
- $.definitions.artifactSetDefinition
- $.definitions.artifactSetSnapshot
input-file:
- Microsoft.Chaos/preview/2022-07-01-preview/artifacts.json
- Microsoft.Chaos/preview/2022-07-01-preview/capabilities.json
- Microsoft.Chaos/preview/2022-07-01-preview/experiments.json
- Microsoft.Chaos/preview/2022-07-01-preview/operations.json
- Microsoft.Chaos/preview/2022-07-01-preview/targets.json
- Microsoft.Chaos/preview/2022-07-01-preview/targetTypes.json
- Microsoft.Chaos/preview/2022-07-01-preview/capabilityTypes.json
- Microsoft.Chaos/preview/2021-09-15-preview/capabilities.json
- Microsoft.Chaos/preview/2021-09-15-preview/experiments.json
- Microsoft.Chaos/preview/2021-09-15-preview/operations.json
- Microsoft.Chaos/preview/2021-09-15-preview/targets.json
- Microsoft.Chaos/preview/2021-09-15-preview/targetTypes.json
- Microsoft.Chaos/preview/2021-09-15-preview/capabilityTypes.json
```

### Tag: package-2021-09-15-preview
Expand All @@ -66,15 +61,8 @@ directive:
reason: Patch is not implemented in this version.
where:
- $.definitions.experiment
- suppress: R4017
reason: Proxy resource is not discoverable at the subscription level.
where:
- $.definitions.target
- $.definitions.artifactSetDefinition
- $.definitions.artifactSetSnapshot
input-file:
- Microsoft.Chaos/preview/2021-09-15-preview/artifacts.json
- Microsoft.Chaos/preview/2021-09-15-preview/capabilities.json
- Microsoft.Chaos/preview/2021-09-15-preview/experiments.json
- Microsoft.Chaos/preview/2021-09-15-preview/operations.json
Expand All @@ -83,78 +71,6 @@ input-file:
- Microsoft.Chaos/preview/2021-09-15-preview/capabilityTypes.json
```

### Tag: package-2021-08-11-preview

These settings apply only when `--tag=package-2021-08-11-preview` is specified on the command line.

```yaml $(tag) == 'package-2021-08-11-preview'
directive:
- suppress: R3026
reason: Patch is not implemented in this version.
where:
- $.definitions.experiment
- suppress: R4017
reason: Proxy resource is not discoverable at the subscription level.
where:
- $.definitions.target
- $.definitions.artifactSetDefinition
- $.definitions.artifactSetSnapshot
input-file:
- Microsoft.Chaos/preview/2021-08-11-preview/artifacts.json
- Microsoft.Chaos/preview/2021-08-11-preview/capabilities.json
- Microsoft.Chaos/preview/2021-08-11-preview/experiments.json
- Microsoft.Chaos/preview/2021-08-11-preview/operations.json
- Microsoft.Chaos/preview/2021-08-11-preview/targets.json
```

### Tag: package-2021-07-05-preview

These settings apply only when `--tag=package-2021-07-05-preview` is specified on the command line.

```yaml $(tag) == 'package-2021-07-05-preview'
directive:
- suppress: R3026
reason: Patch is not implemented in this version.
where:
- $.definitions.experiment
- suppress: R4017
reason: Proxy resource is not discoverable at the subscription level.
where:
- $.definitions.target
- $.definitions.artifactSetDefinition
- $.definitions.artifactSetSnapshot
input-file:
- Microsoft.Chaos/preview/2021-07-05-preview/artifacts.json
- Microsoft.Chaos/preview/2021-07-05-preview/capabilities.json
- Microsoft.Chaos/preview/2021-07-05-preview/experiments.json
- Microsoft.Chaos/preview/2021-07-05-preview/operations.json
- Microsoft.Chaos/preview/2021-07-05-preview/targets.json
```

### Tag: package-2021-07-01-preview

These settings apply only when `--tag=package-2021-07-01-preview` is specified on the command line.

```yaml $(tag) == 'package-2021-07-01-preview'
directive:
- suppress: R3026
reason: Patch is not implemented in this version.
where:
- $.definitions.experiment
- suppress: R4017
reason: Proxy resource is not discoverable at the subscription level.
where:
- $.definitions.target
input-file:
- Microsoft.Chaos/preview/2021-07-01-preview/capabilities.json
- Microsoft.Chaos/preview/2021-07-01-preview/experiments.json
- Microsoft.Chaos/preview/2021-07-01-preview/operations.json
- Microsoft.Chaos/preview/2021-07-01-preview/targets.json
```

---

# Code Generation
Expand All @@ -164,16 +80,21 @@ input-file:
This section describes what SDK should be generated by the automatic system.
This is not used by Autorest itself.

```yaml $(swagger-to-sdk)
``` yaml $(swagger-to-sdk)
swagger-to-sdk:
- repo: azure-sdk-for-python-track2
- repo: azure-sdk-for-java
- repo: azure-sdk-for-go
- repo: azure-sdk-for-js
- repo: azure-resource-manager-schemas
- repo: azure-cli-extensions
- repo: azure-powershell
```

## Az

See configuration in [readme.az.md](./readme.az.md)

## Go

See configuration in [readme.go.md](./readme.go.md)
Expand All @@ -189,3 +110,27 @@ See configuration in [readme.typescript.md](./readme.typescript.md)
## CSharp

See configuration in [readme.csharp.md](./readme.csharp.md)

## Suppression

``` yaml
directive:
- suppress: TopLevelResourcesListBySubscription
where: $.definitions.target
from: targets.json
reason: |-
We have the top level resource list by subscription operation here: https://github.com/mariohdez/azure-rest-api-specs/blob/5a870f3163ae6e9cc5ed33d40cfff61764050213/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/targets.json#L37
this is a false positive I believe.
- suppress: TopLevelResourcesListBySubscription
where: $.definitions.target
from: targets.json
reason: |-
we defined the toplevelresourcelistbysubscription here:
https://github.com/mariohdez/azure-rest-api-specs/blob/5a870f3163ae6e9cc5ed33d40cfff61764050213/specification/chaos/resource-manager/Microsoft.Chaos/preview/2021-09-15-preview/targets.json#L37
- suppress: EnumInsteadOfBoolean
where: $.definitions.Operation.properties.isDataAction
from: types.json
reason: We are consuming the type model declaration from "common". I don't think our service is responsible for updating this error... Plz push back otherwise.
```

0 comments on commit 2a4ce96

Please sign in to comment.