Skip to content
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

fix: automation model validation errors #6782

Merged

Conversation

nschonni
Copy link
Contributor

  • Add "body" for RESPONSE_BODY_NOT_IN_EXAMPLE errors
  • "path" -> "folderPath"

- Add "body" for RESPONSE_BODY_NOT_IN_EXAMPLE errors
- "path" -> "folderPath"
@openapi-sdkautomation
Copy link

openapi-sdkautomation bot commented Jul 30, 2019

SDK Automation [Logs] (Generated from 7c45716, Iteration 1)

Succeeded Python: Azure/azure-sdk-for-python [Logs] [Diff]
Warning Go: test-repo-billy/azure-sdk-for-go [Logs] [Diff]
  • Warning automation/mgmt/2015-10-31 [Logs]
  • Warning preview/automation/mgmt/2017-05-15-preview [Logs]
  • Warning preview/automation/mgmt/2018-01-15-preview [Logs]
  • Warning preview/automation/mgmt/2018-06-30-preview [Logs]
Succeeded JavaScript: Azure/azure-sdk-for-js [Logs] [Diff]
Succeeded Ruby: Azure/azure-sdk-for-ruby [Logs] [Diff]

@AutorestCI
Copy link

AutorestCI commented Jul 30, 2019

Automation for azure-sdk-for-python

Unable to detect any generation context from this PR.

@AutorestCI
Copy link

AutorestCI commented Jul 30, 2019

Automation for azure-sdk-for-go

Unable to detect any generation context from this PR.

@azuresdkci
Copy link
Contributor

Can one of the admins verify this patch?

Copy link
Member

@raych1 raych1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nschonni , can you run OAV locally see if the result looks good since all the changes are in examples?

@nschonni
Copy link
Contributor Author

@raych1 here are the outstanding errors (I only fixed those ones mentioned in the commit message), just FYI, here are the still failing rules:

oav validate-example specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/job.json -p
Validating "examples" and "x-ms-examples" in  specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/job.json:

 error : 
operationId: Job_GetOutput
scenario: Get Job Output
source: response
responseCode: '200'
severity: 0
code: INVALID_TYPE
details:
  code: INVALID_TYPE
  params:
    - file
    - string
  message: Expected type file but found type string
  path: ''
  jsonPath: ''

 error : 
operationId: Job_GetRunbookContent
scenario: Get Job Runbook Content
source: response
responseCode: '200'
severity: 1
code: INVALID_CONTENT_TYPE
details:
  code: INVALID_CONTENT_TYPE
  message: >-
    Invalid Content-Type (text/powershell).  These are supported:
    application/json
  path: ''
  jsonPath: ''

 error : 
operationId: Job_GetRunbookContent
scenario: Get Job Runbook Content
source: response
responseCode: '200'
severity: 0
code: INVALID_TYPE
details:
  code: INVALID_TYPE
  params:
    - file
    - string
  message: Expected type file but found type string
  path: ''
  jsonPath: ''
oav validate-example specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/softwareUpdateConfiguration.json -p
Validating "examples" and "x-ms-examples" in  specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/softwareUpdateConfiguration.json:

 error : 
operationId: SoftwareUpdateConfigurations_Create
scenario: Create software update configuration
source: request
responseCode: ALL
severity: 0
code: INVALID_TYPE
details:
  code: INVALID_TYPE
  params:
    - object
    - array
  message: Expected type object but found type array
  path: properties/updateConfiguration/targets/azureQueries/0/tagSettings/tags
  title: '#/definitions/TagSettingsProperties/properties/tags'
  description: Dictionary of tags with its list of values.
  jsonPath: '$.properties.updateConfiguration.targets.azureQueries[0].tagSettings.tags'
  position:
    line: 835
    column: 17
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/softwareUpdateConfiguration.json
  directives: {}

 error : 
operationId: SoftwareUpdateConfigurations_List
scenario: List software update configurations
source: response
responseCode: '200'
severity: 0
code: OBJECT_ADDITIONAL_PROPERTIES
details:
  code: OBJECT_ADDITIONAL_PROPERTIES
  params:
    - nonAzureComputerNames
  message: 'Additional properties not allowed: nonAzureComputerNames'
  path: value/0/properties/updateConfiguration/nonAzureComputerNames
  title: '#/definitions/collectionItemUpdateConfiguration'
  description: >-
    object returned when requesting a collection of software update
    configuration
  position:
    line: 705
    column: 42
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/softwareUpdateConfiguration.json
  directives: {}
  jsonUrl: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurations.json
  jsonPath: '$.value[0].properties.updateConfiguration.nonAzureComputerNames'
  similarPaths:
    - value/1/properties/updateConfiguration/nonAzureComputerNames
  similarJsonPaths:
    - '$.value[1].properties.updateConfiguration.nonAzureComputerNames'

 error : 
operationId: SoftwareUpdateConfigurations_List
scenario: List software update configurations
source: response
responseCode: '200'
severity: 0
code: OBJECT_ADDITIONAL_PROPERTIES
details:
  code: OBJECT_ADDITIONAL_PROPERTIES
  params:
    - targets
  message: 'Additional properties not allowed: targets'
  path: value/0/properties/updateConfiguration/targets
  title: '#/definitions/collectionItemUpdateConfiguration'
  description: >-
    object returned when requesting a collection of software update
    configuration
  position:
    line: 705
    column: 42
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/softwareUpdateConfiguration.json
  directives: {}
  jsonUrl: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurations.json
  jsonPath: '$.value[0].properties.updateConfiguration.targets'
  similarPaths:
    - value/1/properties/updateConfiguration/targets
  similarJsonPaths:
    - '$.value[1].properties.updateConfiguration.targets'

 error : 
operationId: SoftwareUpdateConfigurations_List
scenario: List software update configurations
source: response
responseCode: '200'
severity: 0
code: OBJECT_ADDITIONAL_PROPERTIES
details:
  code: OBJECT_ADDITIONAL_PROPERTIES
  params:
    - linux
  message: 'Additional properties not allowed: linux'
  path: value/0/properties/updateConfiguration/linux
  title: '#/definitions/collectionItemUpdateConfiguration'
  description: >-
    object returned when requesting a collection of software update
    configuration
  position:
    line: 705
    column: 42
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/softwareUpdateConfiguration.json
  directives: {}
  jsonUrl: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurations.json
  jsonPath: '$.value[0].properties.updateConfiguration.linux'
  similarPaths:
    - value/1/properties/updateConfiguration/linux
  similarJsonPaths:
    - '$.value[1].properties.updateConfiguration.linux'

 error : 
operationId: SoftwareUpdateConfigurations_List
scenario: List software update configurations
source: response
responseCode: '200'
severity: 0
code: OBJECT_ADDITIONAL_PROPERTIES
details:
  code: OBJECT_ADDITIONAL_PROPERTIES
  params:
    - windows
  message: 'Additional properties not allowed: windows'
  path: value/0/properties/updateConfiguration/windows
  title: '#/definitions/collectionItemUpdateConfiguration'
  description: >-
    object returned when requesting a collection of software update
    configuration
  position:
    line: 705
    column: 42
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/softwareUpdateConfiguration.json
  directives: {}
  jsonUrl: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurations.json
  jsonPath: '$.value[0].properties.updateConfiguration.windows'
  similarPaths:
    - value/1/properties/updateConfiguration/windows
  similarJsonPaths:
    - '$.value[1].properties.updateConfiguration.windows'

 error : 
operationId: SoftwareUpdateConfigurations_List
scenario: List software update configurations
source: response
responseCode: '200'
severity: 0
code: OBJECT_ADDITIONAL_PROPERTIES
details:
  code: OBJECT_ADDITIONAL_PROPERTIES
  params:
    - operatingSystem
  message: 'Additional properties not allowed: operatingSystem'
  path: value/0/properties/updateConfiguration/operatingSystem
  title: '#/definitions/collectionItemUpdateConfiguration'
  description: >-
    object returned when requesting a collection of software update
    configuration
  position:
    line: 705
    column: 42
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/softwareUpdateConfiguration.json
  directives: {}
  jsonUrl: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurations.json
  jsonPath: '$.value[0].properties.updateConfiguration.operatingSystem'
  similarPaths:
    - value/1/properties/updateConfiguration/operatingSystem
  similarJsonPaths:
    - '$.value[1].properties.updateConfiguration.operatingSystem'

 error : 
operationId: SoftwareUpdateConfigurations_List
scenario: List software update configurations
source: response
responseCode: '200'
severity: 0
code: OBJECT_ADDITIONAL_PROPERTIES
details:
  code: OBJECT_ADDITIONAL_PROPERTIES
  params:
    - tasks
  message: 'Additional properties not allowed: tasks'
  path: value/0/properties/tasks
  title: '#/definitions/softwareUpdateConfigurationCollectionItemProperties'
  description: Software update configuration collection item properties.
  position:
    line: 723
    column: 60
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/softwareUpdateConfiguration.json
  directives: {}
  jsonUrl: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurations.json
  jsonPath: '$.value[0].properties.tasks'
  similarPaths:
    - value/1/properties/tasks
  similarJsonPaths:
    - '$.value[1].properties.tasks'

 error : 
operationId: SoftwareUpdateConfigurations_List
scenario: List software update configurations Targeting a specific azure virtual machine
source: response
responseCode: '200'
severity: 0
code: OBJECT_ADDITIONAL_PROPERTIES
details:
  code: OBJECT_ADDITIONAL_PROPERTIES
  params:
    - nonAzureComputerNames
  message: 'Additional properties not allowed: nonAzureComputerNames'
  path: value/0/properties/updateConfiguration/nonAzureComputerNames
  title: '#/definitions/collectionItemUpdateConfiguration'
  description: >-
    object returned when requesting a collection of software update
    configuration
  position:
    line: 705
    column: 42
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/softwareUpdateConfiguration.json
  directives: {}
  jsonUrl: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurationsByVm.json
  jsonPath: '$.value[0].properties.updateConfiguration.nonAzureComputerNames'
  similarPaths:
    - value/1/properties/updateConfiguration/nonAzureComputerNames
  similarJsonPaths:
    - '$.value[1].properties.updateConfiguration.nonAzureComputerNames'

 error : 
operationId: SoftwareUpdateConfigurations_List
scenario: List software update configurations Targeting a specific azure virtual machine
source: response
responseCode: '200'
severity: 0
code: OBJECT_ADDITIONAL_PROPERTIES
details:
  code: OBJECT_ADDITIONAL_PROPERTIES
  params:
    - linux
  message: 'Additional properties not allowed: linux'
  path: value/0/properties/updateConfiguration/linux
  title: '#/definitions/collectionItemUpdateConfiguration'
  description: >-
    object returned when requesting a collection of software update
    configuration
  position:
    line: 705
    column: 42
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/softwareUpdateConfiguration.json
  directives: {}
  jsonUrl: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurationsByVm.json
  jsonPath: '$.value[0].properties.updateConfiguration.linux'
  similarPaths:
    - value/1/properties/updateConfiguration/linux
  similarJsonPaths:
    - '$.value[1].properties.updateConfiguration.linux'

 error : 
operationId: SoftwareUpdateConfigurations_List
scenario: List software update configurations Targeting a specific azure virtual machine
source: response
responseCode: '200'
severity: 0
code: OBJECT_ADDITIONAL_PROPERTIES
details:
  code: OBJECT_ADDITIONAL_PROPERTIES
  params:
    - windows
  message: 'Additional properties not allowed: windows'
  path: value/0/properties/updateConfiguration/windows
  title: '#/definitions/collectionItemUpdateConfiguration'
  description: >-
    object returned when requesting a collection of software update
    configuration
  position:
    line: 705
    column: 42
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/softwareUpdateConfiguration.json
  directives: {}
  jsonUrl: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurationsByVm.json
  jsonPath: '$.value[0].properties.updateConfiguration.windows'
  similarPaths:
    - value/1/properties/updateConfiguration/windows
  similarJsonPaths:
    - '$.value[1].properties.updateConfiguration.windows'

 error : 
operationId: SoftwareUpdateConfigurations_List
scenario: List software update configurations Targeting a specific azure virtual machine
source: response
responseCode: '200'
severity: 0
code: OBJECT_ADDITIONAL_PROPERTIES
details:
  code: OBJECT_ADDITIONAL_PROPERTIES
  params:
    - operatingSystem
  message: 'Additional properties not allowed: operatingSystem'
  path: value/0/properties/updateConfiguration/operatingSystem
  title: '#/definitions/collectionItemUpdateConfiguration'
  description: >-
    object returned when requesting a collection of software update
    configuration
  position:
    line: 705
    column: 42
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/softwareUpdateConfiguration.json
  directives: {}
  jsonUrl: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurationsByVm.json
  jsonPath: '$.value[0].properties.updateConfiguration.operatingSystem'
  similarPaths:
    - value/1/properties/updateConfiguration/operatingSystem
  similarJsonPaths:
    - '$.value[1].properties.updateConfiguration.operatingSystem'

 error : 
operationId: SoftwareUpdateConfigurations_List
scenario: List software update configurations Targeting a specific azure virtual machine
source: response
responseCode: '200'
severity: 0
code: OBJECT_ADDITIONAL_PROPERTIES
details:
  code: OBJECT_ADDITIONAL_PROPERTIES
  params:
    - tasks
  message: 'Additional properties not allowed: tasks'
  path: value/0/properties/tasks
  title: '#/definitions/softwareUpdateConfigurationCollectionItemProperties'
  description: Software update configuration collection item properties.
  position:
    line: 723
    column: 60
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/softwareUpdateConfiguration.json
  directives: {}
  jsonUrl: >-
    specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurationsByVm.json
  jsonPath: '$.value[0].properties.tasks'
  similarPaths:
    - value/1/properties/tasks
  similarJsonPaths:
    - '$.value[1].properties.tasks'

This one seems like a bug, because a Delete probably shouldn't be returning anything

oav validate-example specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/connection.json -pValidating "examples" and "x-ms-examples" in  specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/connection.json:

 error : 
operationId: Connection_Delete
scenario: Delete an existing connection
source: response
responseCode: '200'
severity: 0
code: RESPONSE_BODY_NOT_IN_EXAMPLE
details:
  code: RESPONSE_BODY_NOT_IN_EXAMPLE
  id: OAV130
  message: >-
    Response statusCode "200" for operation "Connection_Delete" has no response
    body provided in the example, however the response does have a "schema"
    defined in the swagger spec.
  position:
    line: 40
    column: 17
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/connection.json
  title: >-
    #/paths/~1subscriptions~1{subscriptionId}~1resourceGroups~1{resourceGroupName}~1providers~1Microsoft.Automation~1automationAccounts~1{automationAccountName}~1connections~1{connectionName}/delete
  directives: {}
  level: error
oav validate-example specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/connectionType.json -p
Validating "examples" and "x-ms-examples" in  specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/connectionType.json:

 error : 
operationId: ConnectionType_CreateOrUpdate
scenario: Create or update connection type
source: response
responseCode: '409'
severity: 0
code: RESPONSE_BODY_NOT_IN_EXAMPLE
details:
  code: RESPONSE_BODY_NOT_IN_EXAMPLE
  id: OAV130
  message: >-
    Response statusCode "409" for operation "ConnectionType_CreateOrUpdate" has
    no response body provided in the example, however the response does have a
    "schema" defined in the swagger spec.
  position:
    line: 140
    column: 14
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/connectionType.json
  title: >-
    #/paths/~1subscriptions~1{subscriptionId}~1resourceGroups~1{resourceGroupName}~1providers~1Microsoft.Automation~1automationAccounts~1{automationAccountName}~1connectionTypes~1{connectionTypeName}/put
  directives: {}
  level: error
oav validate-example specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/dscConfiguration.json -p
Validating "examples" and "x-ms-examples" in  specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/dscConfiguration.json:

 error : 
operationId: DscConfiguration_GetContent
scenario: Get DSC Configuration content
source: response
responseCode: '200'
severity: 0
code: INVALID_TYPE
details:
  code: INVALID_TYPE
  params:
    - file
    - string
  message: Expected type file but found type string
  path: ''
  jsonPath: ''
oav validate-example specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/dscNode.json -p
Validating "examples" and "x-ms-examples" in  specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/dscNode.json:

 error : 
operationId: DscNode_Delete
scenario: Delete a DSC Node
source: response
responseCode: '200'
severity: 0
code: RESPONSE_BODY_NOT_IN_EXAMPLE
details:
  code: RESPONSE_BODY_NOT_IN_EXAMPLE
  id: OAV130
  message: >-
    Response statusCode "200" for operation "DscNode_Delete" has no response
    body provided in the example, however the response does have a "schema"
    defined in the swagger spec.
  position:
    line: 139
    column: 17
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/dscNode.json
  title: >-
    #/paths/~1subscriptions~1{subscriptionId}~1resourceGroups~1{resourceGroupName}~1providers~1Microsoft.Automation~1automationAccounts~1{automationAccountName}~1nodes~1{nodeId}/delete
  directives: {}
  level: error
oav validate-example specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/job.json -p
Validating "examples" and "x-ms-examples" in  specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/job.json:

 error : 
operationId: Job_GetOutput
scenario: Get Job
source: response
responseCode: '200'
severity: 0
code: INVALID_TYPE
details:
  code: INVALID_TYPE
  message: Expected type file but found type object
  path: ''
  jsonPath: ''

Some missing response bodies in the examples

oav validate-example specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/runbook.json -p
Validating "examples" and "x-ms-examples" in  specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/runbook.json:

 error : 
operationId: RunbookDraft_GetContent
scenario: Get runbook draft content
source: response
responseCode: '200'
severity: 0
code: INVALID_TYPE
details:
  code: INVALID_TYPE
  params:
    - file
    - string
  message: Expected type file but found type string
  path: ''
  jsonPath: ''

 error : 
operationId: RunbookDraft_ReplaceContent
scenario: Create or update runbook draft
source: response
responseCode: '200'
severity: 0
code: RESPONSE_STATUS_CODE_NOT_IN_EXAMPLE
details:
  code: RESPONSE_STATUS_CODE_NOT_IN_EXAMPLE
  id: OAV111
  message: >-
    Following response status codes "200" for operation
    "RunbookDraft_ReplaceContent" were present in the swagger spec, however they
    were not present in x-ms-examples. Please provide them.
  position:
    line: 93
    column: 14
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/runbook.json
  title: >-
    #/paths/~1subscriptions~1{subscriptionId}~1resourceGroups~1{resourceGroupName}~1providers~1Microsoft.Automation~1automationAccounts~1{automationAccountName}~1runbooks~1{runbookName}~1draft~1content/put
  directives: {}
  level: error

 error : 
operationId: RunbookDraft_UndoEdit
scenario: Undo draft edit to last known published state
source: response
responseCode: '200'
severity: 0
code: RESPONSE_BODY_NOT_IN_EXAMPLE
details:
  code: RESPONSE_BODY_NOT_IN_EXAMPLE
  id: OAV130
  message: >-
    Response statusCode "200" for operation "RunbookDraft_UndoEdit" has no
    response body provided in the example, however the response does have a
    "schema" defined in the swagger spec.
  position:
    line: 276
    column: 15
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/runbook.json
  title: >-
    #/paths/~1subscriptions~1{subscriptionId}~1resourceGroups~1{resourceGroupName}~1providers~1Microsoft.Automation~1automationAccounts~1{automationAccountName}~1runbooks~1{runbookName}~1draft~1undoEdit/post
  directives: {}
  level: error

 error : 
operationId: Runbook_GetContent
scenario: Get runbook content
source: response
responseCode: '200'
severity: 0
code: INVALID_TYPE
details:
  code: INVALID_TYPE
  params:
    - file
    - string
  message: Expected type file but found type string
  path: ''
  jsonPath: ''
oav validate-example specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/watcher.json -p
Validating "examples" and "x-ms-examples" in  specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/watcher.json:

 error : 
operationId: Watcher_CreateOrUpdate
scenario: Create or update watcher
source: request
responseCode: ALL
severity: 0
code: READONLY_PROPERTY_NOT_ALLOWED_IN_REQUEST
details:
  code: READONLY_PROPERTY_NOT_ALLOWED_IN_REQUEST
  params:
    - creationTime
    - '2016-11-01T04:22:47.7333333-07:00'
  message: >-
    ReadOnly property `"creationTime": "2016-11-01T04:22:47.7333333-07:00"`,
    cannot be sent in the request.
  path: properties/creationTime
  title: '#/definitions/WatcherProperties/properties/creationTime'
  description: Gets or sets the creation time.
  jsonPath: $.properties.creationTime
  position:
    line: 464
    column: 25
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/watcher.json
  directives: {}

 error : 
operationId: Watcher_CreateOrUpdate
scenario: Create or update watcher
source: request
responseCode: ALL
severity: 0
code: READONLY_PROPERTY_NOT_ALLOWED_IN_REQUEST
details:
  code: READONLY_PROPERTY_NOT_ALLOWED_IN_REQUEST
  params:
    - lastModifiedTime
    - '2016-11-01T04:22:47.7333333-07:00'
  message: >-
    ReadOnly property `"lastModifiedTime": "2016-11-01T04:22:47.7333333-07:00"`,
    cannot be sent in the request.
  path: properties/lastModifiedTime
  title: '#/definitions/WatcherProperties/properties/lastModifiedTime'
  description: Gets or sets the last modified time.
  jsonPath: $.properties.lastModifiedTime
  position:
    line: 471
    column: 29
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/watcher.json
  directives: {}

 error : 
operationId: Watcher_CreateOrUpdate
scenario: Create or update watcher
source: request
responseCode: ALL
severity: 0
code: READONLY_PROPERTY_NOT_ALLOWED_IN_REQUEST
details:
  code: READONLY_PROPERTY_NOT_ALLOWED_IN_REQUEST
  params:
    - name
    - MyTestWatcher
  message: 'ReadOnly property `"name": "MyTestWatcher"`, cannot be sent in the request.'
  path: name
  title: '#/definitions/Resource/properties/name'
  description: The name of the resource
  jsonPath: $.name
  position:
    line: 50
    column: 17
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/common/v1/definitions.json
  directives: {}
oav validate-example specification/automation/resource-manager/Microsoft.Automation/stable/2018-01-15/dscNode.json -p
Validating "examples" and "x-ms-examples" in  specification/automation/resource-manager/Microsoft.Automation/stable/2018-01-15/dscNode.json:

 error : 
operationId: DscNode_Delete
scenario: Delete a DSC Node
source: response
responseCode: '200'
severity: 0
code: RESPONSE_BODY_NOT_IN_EXAMPLE
details:
  code: RESPONSE_BODY_NOT_IN_EXAMPLE
  id: OAV130
  message: >-
    Response statusCode "200" for operation "DscNode_Delete" has no response
    body provided in the example, however the response does have a "schema"
    defined in the swagger spec.
  position:
    line: 140
    column: 17
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/stable/2018-01-15/dscNode.json
  title: >-
    #/paths/~1subscriptions~1{subscriptionId}~1resourceGroups~1{resourceGroupName}~1providers~1Microsoft.Automation~1automationAccounts~1{automationAccountName}~1nodes~1{nodeId}/delete
  directives: {}
  level: error
oav validate-example specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/runbook.json -p
Validating "examples" and "x-ms-examples" in  specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/runbook.json:

 error : 
operationId: RunbookDraft_GetContent
scenario: Get runbook draft content
source: response
responseCode: '200'
severity: 0
code: INVALID_TYPE
details:
  code: INVALID_TYPE
  params:
    - file
    - string
  message: Expected type file but found type string
  path: ''
  jsonPath: ''

 error : 
operationId: RunbookDraft_ReplaceContent
scenario: Create or update runbook draft
source: response
responseCode: '200'
severity: 0
code: RESPONSE_BODY_NOT_IN_EXAMPLE
details:
  code: RESPONSE_BODY_NOT_IN_EXAMPLE
  id: OAV130
  message: >-
    Response statusCode "200" for operation "RunbookDraft_ReplaceContent" has no
    response body provided in the example, however the response does have a
    "schema" defined in the swagger spec.
  position:
    line: 93
    column: 14
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/runbook.json
  title: >-
    #/paths/~1subscriptions~1{subscriptionId}~1resourceGroups~1{resourceGroupName}~1providers~1Microsoft.Automation~1automationAccounts~1{automationAccountName}~1runbooks~1{runbookName}~1draft~1content/put
  directives: {}
  level: error

 error : 
operationId: RunbookDraft_ReplaceContent
scenario: Create or update runbook draft
source: response
responseCode: '202'
severity: 0
code: RESPONSE_SCHEMA_NOT_IN_SPEC
details:
  code: RESPONSE_SCHEMA_NOT_IN_SPEC
  id: OAV113
  message: >-
    Response statusCode "202" for operation "RunbookDraft_ReplaceContent" has
    response body provided in the example, however the response does not have a
    "schema" defined in the swagger spec.
  position:
    line: 93
    column: 14
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/runbook.json
  title: >-
    #/paths/~1subscriptions~1{subscriptionId}~1resourceGroups~1{resourceGroupName}~1providers~1Microsoft.Automation~1automationAccounts~1{automationAccountName}~1runbooks~1{runbookName}~1draft~1content/put
  directives: {}
  level: error

 error : 
operationId: RunbookDraft_UndoEdit
scenario: Undo draft edit to last known published state
source: response
responseCode: '200'
severity: 0
code: RESPONSE_BODY_NOT_IN_EXAMPLE
details:
  code: RESPONSE_BODY_NOT_IN_EXAMPLE
  id: OAV130
  message: >-
    Response statusCode "200" for operation "RunbookDraft_UndoEdit" has no
    response body provided in the example, however the response does have a
    "schema" defined in the swagger spec.
  position:
    line: 276
    column: 15
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/runbook.json
  title: >-
    #/paths/~1subscriptions~1{subscriptionId}~1resourceGroups~1{resourceGroupName}~1providers~1Microsoft.Automation~1automationAccounts~1{automationAccountName}~1runbooks~1{runbookName}~1draft~1undoEdit/post
  directives: {}
  level: error

 error : 
operationId: Runbook_GetContent
scenario: Get runbook content
source: response
responseCode: '200'
severity: 0
code: INVALID_TYPE
details:
  code: INVALID_TYPE
  params:
    - file
    - string
  message: Expected type file but found type string
  path: ''
  jsonPath: ''

 error : 
operationId: Runbook_Update
scenario: Update runbook
source: response
responseCode: '200'
severity: 0
code: RESPONSE_BODY_NOT_IN_EXAMPLE
details:
  code: RESPONSE_BODY_NOT_IN_EXAMPLE
  id: OAV130
  message: >-
    Response statusCode "200" for operation "Runbook_Update" has no response
    body provided in the example, however the response does have a "schema"
    defined in the swagger spec.
  position:
    line: 501
    column: 16
  url: >-
    specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/runbook.json
  title: >-
    #/paths/~1subscriptions~1{subscriptionId}~1resourceGroups~1{resourceGroupName}~1providers~1Microsoft.Automation~1automationAccounts~1{automationAccountName}~1runbooks~1{runbookName}/patch
  directives: {}
  level: error

@raych1
Copy link
Member

raych1 commented Jul 31, 2019

Thanks @nschonni , there're a few invalid_type errors. Do you know how cause this?

@nschonni
Copy link
Contributor Author

I think Swagger 2 or the current x-ms-example stuff doesn't have a good way to represent file responses in an example.

@raych1
Copy link
Member

raych1 commented Aug 2, 2019

@nschonni , can we use this PR and add more commits to fix other errors?

@nschonni
Copy link
Contributor Author

nschonni commented Aug 2, 2019

Sure if you want. The "allow edits from maintainers" checkbox is on

@raych1
Copy link
Member

raych1 commented Aug 2, 2019

Sorry, what I meant is will you continue to fix other errors along with this PR?

@nschonni
Copy link
Contributor Author

nschonni commented Aug 2, 2019

Ah, no I don't think I can fix any of those other ones. EX: removing the response schema from the deletes would probably be a breaking change, and it could be correct. Also adding the response I'd need to know what they'd look like.
Probably better to spin up issues for those so the service owner can take a look

@raych1
Copy link
Member

raych1 commented Aug 2, 2019

I see, comes back to this PR. What's the reason changing path to folderPath?

@nschonni
Copy link
Contributor Author

nschonni commented Aug 2, 2019

The property is "folderPath" in the spec rather than "path"

"folderPath": {
"type": "string",
"description": "The folder path of the source control. Path must be relative."
},

Could be a spec error, and I can undo it if you want

Copy link
Member

@raych1 raych1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me for the fixes.

@raych1 raych1 merged commit 43bbc32 into Azure:master Aug 2, 2019
@nschonni nschonni deleted the fix--automation-model-validation-errors branch August 2, 2019 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants