Skip to content

Commit

Permalink
Fix TimeSeriesInsights swagger issues (#12204)
Browse files Browse the repository at this point in the history
* add polymorphism

* fix polymorphy issues for enviroment update and event-source update

* remove readme.az.md

* remove readme.cli.md

* add suppress for kind property in timeseriesinsights.json
  • Loading branch information
kairu-ms authored Feb 10, 2021
1 parent 56a09bd commit 24c565d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,21 @@
},
"EnvironmentUpdateParameters": {
"type": "object",
"discriminator": "kind",
"properties": {
"kind": {
"type": "string",
"readOnly": true,
"description": "The kind of the environment.",
"enum": [
"Gen1",
"Gen2"
],
"x-ms-enum": {
"name": "EnvironmentKind",
"modelAsString": true
}
},
"tags": {
"type": "object",
"additionalProperties": {
Expand All @@ -1419,6 +1433,7 @@
},
"Gen1EnvironmentUpdateParameters": {
"type": "object",
"x-ms-discriminator-value": "Gen1",
"properties": {
"sku": {
"$ref": "#/definitions/Sku",
Expand All @@ -1439,6 +1454,7 @@
},
"Gen2EnvironmentUpdateParameters": {
"type": "object",
"x-ms-discriminator-value": "Gen2",
"properties": {
"properties": {
"x-ms-client-flatten": true,
Expand Down Expand Up @@ -1894,8 +1910,22 @@
"description": "Parameters supplied to the Create or Update Event Source operation for an IoTHub event source."
},
"EventSourceUpdateParameters": {
"discriminator": "kind",
"type": "object",
"properties": {
"kind": {
"type": "string",
"readOnly": true,
"description": "The kind of the event source.",
"enum": [
"Microsoft.EventHub",
"Microsoft.IoTHub"
],
"x-ms-enum": {
"name": "EventSourceKind",
"modelAsString": true
}
},
"tags": {
"type": "object",
"additionalProperties": {
Expand Down
9 changes: 9 additions & 0 deletions specification/timeseriesinsights/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ input-file:

``` yaml
directive:
- suppress: READONLY_PROPERTY_NOT_ALLOWED_IN_REQUEST
where:
- $.definitions.EnvironmentUpdateParameters.properties.kind
- $.definitions.EventSourceUpdateParameters.properties.kind
from: timeseriesinsights.json
reason: This property is the discriminator for polymorph, but it can not be in request body.
- suppress: OAV131 # DISCRIMINATOR_NOT_REQUIRED
from: timeseriesinsights.json
reason: kind is a non-settable property from the client in patch method.
- suppress: R3025 # Tracked resource 'XXX' must have a get operation
where:
- $.definitions.StandardEnvironmentResource
Expand Down

0 comments on commit 24c565d

Please sign in to comment.