Azure / Azure/azure-rest-api-specs

[ManagedApplications] Fix validation errors in examples

Open
#1,191 1 comment 0 reactions 1 assignee Claimed by @MSEvanhi View on GitHub
ARM ARM - Managed Applications bug P1 Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

```
error: code: 'RESPONSE_STATUS_CODE_NOT_IN_EXAMPLE',
message: 'Following response status codes "404" for operation "Appliances_Get" were present in the swagger spec, however they were not present in x-ms-examples. Please provide them.' }
```

```
error: Found errors in validating the response with statusCode "200" for x-ms-example "Get an appliance" in operation "Appliances_Get".:
code: 'RESPONSE_VALIDATION_ERROR',
message: 'Found errors in validating the response with statusCode "200" for x-ms-example "Get an appliance" in operation "Appliances_Get".',
innerErrors:
[ { code: 'INVALID_RESPONSE_BODY',
errors:
[ { code: 'OBJECT_ADDITIONAL_PROPERTIES',
params: [ [ 'resourceGroup' ] ],
message: 'Additional properties not allowed: resourceGroup',
path: [],
description: 'Information about appliance.' },
{ code: 'INVALID_TYPE',
params: [ [ 'array', 'boolean', 'number', 'object', 'string' ], 'null' ],
message: 'Expected type array,boolean,number,object,string but found type null',
path: [ 'properties', 'parameters' ],
description: 'Name and value pairs that define the appliance parameters. It can be a JObject or a well formed JSON string.' },
{ code: 'INVALID_TYPE',
params: [ [ 'array', 'boolean', 'number', 'object', 'string' ], 'null' ],
message: 'Expected type array,boolean,number,object,string but found type null',
path: [ 'properties', 'outputs' ],
description: 'Name and value pairs that define the appliance outputs.' },
{ code: 'INVALID_TYPE',
params: [ [ 'array', 'boolean', 'number', 'object', 'string' ], 'null' ],
message: 'Expected type array,boolean,number,object,string but found type null',
path: [ 'tags' ],
description: 'Resource tags' },
{ code: 'INVALID_TYPE',
params: [ 'string', 'null' ],
message: 'Expected type string but found type null',
path: [ 'managedBy' ],
description: 'ID of the resource that manages this resource.' } ],
message: 'Invalid body: Value failed JSON Schema validation',
path: [] } ] }
```

```
error: Found errors in validating the response with statusCode "404" for x-ms-example "Get an appliance" in operation "Appliances_Get".:

code: 'RESPONSE_VALIDATION_ERROR',
message: 'Found errors in validating the response with statusCode "404" for x-ms-example "Get an appliance" in operation "Appliances_Get".',
innerErrors:
[ { code: 'RESPONSE_STATUS_CODE_NOT_IN_EXAMPLE',
message: 'Following response status codes "404" for operation "Appliances_Get" were present in the swagger spec, however they were not present in x-ms-examples. Please provide them.' } ] }
```

```
error:
{ code: 'RESPONSE_STATUS_CODE_NOT_IN_EXAMPLE',
message: 'Following response status codes "200" for operation "Appliances_CreateOrUpdate" were present in the swagger spec, however they were not present in x-ms-examples. Please provide them.' }
```

```
error: Found errors in validating the response with statusCode "200" for x-ms-example "Create or update appliance" in operation "Appliances_CreateOrUpdate".:

{ code: 'RESPONSE_VALIDATION_ERROR',
message: 'Found errors in validating the response with statusCode "200" for x-ms-example "Create or update appliance" in operation "Appliances_CreateOrUpdate".',
innerErrors:
[ { code: 'RESPONSE_STATUS_CODE_NOT_IN_EXAMPLE',
message: 'Following response status codes "200" for operation "Appliances_CreateOrUpdate" were present in the swagger spec, however they were not present in x-ms-examples. Please provide them.' } ] }
```

```
error: Found errors in validating the response with statusCode "201" for x-ms-example "Create or update appliance" in operation "Appliances_CreateOrUpdate".:


{ code: 'RESPONSE_VALIDATION_ERROR',
message: 'Found errors in validating the response with statusCode "201" for x-ms-example "Create or update appliance" in operation "Appliances_CreateOrUpdate".',
innerErrors:
[ { code: 'INVALID_RESPONSE_BODY',
errors:
[ { code: 'OBJECT_ADDITIONAL_PROPERTIES',
params: [ [ 'resourceGroup' ] ],
message: 'Additional properties not allowed: resourceGroup',
path: [],
description: 'Information about appliance.' },
{ code: 'INVALID_TYPE',
params: [ [ 'array', 'boolean', 'number', 'object', 'string' ], 'null' ],
message: 'Expected type array,boolean,number,object,string but found type null',
path: [ 'properties', 'parameters' ],
description: 'Name and value pairs that define the appliance parameters. It can be a JObject or a well formed JSON string.' },
{ code: 'INVALID_TYPE',
params: [ [ 'array', 'boolean', 'number', 'object', 'string' ], 'null' ],
message: 'Expected type array,boolean,number,object,string but found type null',
path: [ 'properties', 'outputs' ],
description: 'Name and value pairs that define the appliance outputs.' },
{ code: 'INVALID_TYPE',
params: [ [ 'array', 'boolean', 'number', 'object', 'string' ], 'null' ],
message: 'Expected type array,boolean,number,object,string but found type null',
path: [ 'tags' ],
description: 'Resource tags' },
{ code: 'INVALID_TYPE',
params: [ 'string', 'null' ],
message: 'Expected type string but found type null',
path: [ 'managedBy' ],
description: 'ID of the resource that manages this resource.' } ],
message: 'Invalid body: Value failed JSON Schema validation',
path: [] } ] }
```

```
error:
{ code: 'RESPONSE_STATUS_CODE_NOT_IN_EXAMPLE',
message: 'Following response status codes "404" for operation "ApplianceDefinitions_Get" were present in the swagger spec, however they were not present in x-ms-examples. Please provide them.' }
```

```
error: Found errors in validating the request for x-ms-example "Get appliance definition" in operation "ApplianceDefinitions_Get".:

{ code: 'REQUEST_VALIDATION_ERROR',
message: 'Found errors in validating the request for x-ms-example "Get appliance definition" in operation "ApplianceDefinitions_Get".',
innerErrors:
[ { code: 'REQUIRED_PARAMETER_EXAMPLE_NOT_FOUND',
message: 'In operation "ApplianceDefinitions_Get", parameter applianceDefinitionName is required in the swagger spec but is not present in the provided example parameter values.' } ] }
```

```
error: Found errors in validating the response with statusCode "200" for x-ms-example "Get appliance definition" in operation "ApplianceDefinitions_Get".:

{ code: 'RESPONSE_VALIDATION_ERROR',
message: 'Found errors in validating the response with statusCode "200" for x-ms-example "Get appliance definition" in operation "ApplianceDefinitions_Get".',
innerErrors:
[ { code: 'INVALID_RESPONSE_BODY',
errors:
[ { code: 'OBJECT_ADDITIONAL_PROPERTIES',
params: [ [ 'resourceGroup' ] ],
message: 'Additional properties not allowed: resourceGroup',
path: [],
description: 'Information about appliance definition.' },
{ code: 'INVALID_TYPE',
params: [ 'string', 'null' ],
message: 'Expected type string but found type null',
path: [ 'properties', 'lockLevel' ],
description: 'The appliance lock level.' },
{ code: 'ENUM_MISMATCH',
params: [ null ],
message: 'No enum match for: null',
path: [ 'properties', 'lockLevel' ],
description: 'The appliance lock level.' },
{ code: 'INVALID_TYPE',
params: [ [ 'array', 'boolean', 'number', 'object', 'string' ], 'null' ],
message: 'Expected type array,boolean,number,object,string but found type null',
path: [ 'tags' ],
description: 'Resource tags' },
{ code: 'INVALID_TYPE',
params: [ 'string', 'null' ],
message: 'Expected type string but found type null',
path: [ 'managedBy' ],
description: 'ID of the resource that manages this resource.' } ],
message: 'Invalid body: Value failed JSON Schema validation',
path: [] } ] }
```

```
error: Found errors in validating the response with statusCode "404" for x-ms-example "Get appliance definition" in operation "ApplianceDefinitions_Get".:

{ code: 'RESPONSE_VALIDATION_ERROR',
message: 'Found errors in validating the response with statusCode "404" for x-ms-example "Get appliance definition" in operation "ApplianceDefinitions_Get".',
innerErrors:
[ { code: 'RESPONSE_STATUS_CODE_NOT_IN_EXAMPLE',
message: 'Following response status codes "404" for operation "ApplianceDefinitions_Get" were present in the swagger spec, however they were not present in x-ms-examples. Please provide them.' } ] }
```

```
error:
{ code: 'RESPONSE_STATUS_CODE_NOT_IN_EXAMPLE',
message: 'Following response status codes "200" for operation "ApplianceDefinitions_CreateOrUpdate" were present in the swagger spec, however they were not present in x-ms-examples. Please provide them.' }
```

```
error: Found errors in validating the response with statusCode "200" for x-ms-example "Create or update appliance definition" in operation "ApplianceDefinitions_CreateOrUpdate".:

{ code: 'RESPONSE_VALIDATION_ERROR',
message: 'Found errors in validating the response with statusCode "200" for x-ms-example "Create or update appliance definition" in operation "ApplianceDefinitions_CreateOrUpdate".',
innerErrors:
[ { code: 'RESPONSE_STATUS_CODE_NOT_IN_EXAMPLE',
message: 'Following response status codes "200" for operation "ApplianceDefinitions_CreateOrUpdate" were present in the swagger spec, however they were not present in x-ms-examples. Please provide them.' } ] }
```

```
error: Found errors in validating the response with statusCode "201" for x-ms-example "Create or update appliance definition" in operation "ApplianceDefinitions_CreateOrUpdate".:

{ code: 'RESPONSE_VALIDATION_ERROR',
message: 'Found errors in validating the response with statusCode "201" for x-ms-example "Create or update appliance definition" in operation "ApplianceDefinitions_CreateOrUpdate".',
innerErrors:
[ { code: 'INVALID_RESPONSE_BODY',
errors:
[ { code: 'OBJECT_ADDITIONAL_PROPERTIES',
params: [ [ 'resourceGroup' ] ],
message: 'Additional properties not allowed: resourceGroup',
path: [],
description: 'Information about appliance definition.' },
{ code: 'INVALID_TYPE',
params: [ 'string', 'null' ],
message: 'Expected type string but found type null',
path: [ 'properties', 'lockLevel' ],
description: 'The appliance lock level.' },
{ code: 'ENUM_MISMATCH',
params: [ null ],
message: 'No enum match for: null',
path: [ 'properties', 'lockLevel' ],
description: 'The appliance lock level.' },
{ code: 'INVALID_TYPE',
params: [ [ 'array', 'boolean', 'number', 'object', 'string' ], 'null' ],
message: 'Expected type array,boolean,number,object,string but found type null',
path: [ 'tags' ],
description: 'Resource tags' },
{ code: 'INVALID_TYPE',
params: [ 'string', 'null' ],
message: 'Expected type string but found type null',
path: [ 'managedBy' ],
description: 'ID of the resource that manages this resource.' } ],
message: 'Invalid body: Value failed JSON Schema validation',
path: [] } ] }
```

```
error: Found errors in validating the response with statusCode "200" for x-ms-example "List appliance definitions" in operation "ApplianceDefinitions_ListByResourceGroup".:

{ code: 'RESPONSE_VALIDATION_ERROR',
message: 'Found errors in validating the response with statusCode "200" for x-ms-example "List appliance definitions" in operation "ApplianceDefinitions_ListByResourceGroup".',
innerErrors:
[ { code: 'INVALID_RESPONSE_BODY',
errors:
[ { code: 'OBJECT_ADDITIONAL_PROPERTIES',
params: [ [ 'resourceGroup' ] ],
message: 'Additional properties not allowed: resourceGroup',
path: [ 'value', '1' ],
description: 'Information about appliance definition.' },
{ code: 'INVALID_TYPE',
params: [ 'string', 'null' ],
message: 'Expected type string but found type null',
path: [ 'value', '1', 'properties', 'lockLevel' ],
description: 'The appliance lock level.' },
{ code: 'ENUM_MISMATCH',
params: [ null ],
message: 'No enum match for: null',
path: [ 'value', '1', 'properties', 'lockLevel' ],
description: 'The appliance lock level.' },
{ code: 'INVALID_TYPE',
params: [ [ 'array', 'boolean', 'number', 'object', 'string' ], 'null' ],
message: 'Expected type array,boolean,number,object,string but found type null',
path: [ 'value', '1', 'tags' ],
description: 'Resource tags' },
{ code: 'INVALID_TYPE',
params: [ 'string', 'null' ],
message: 'Expected type string but found type null',
path: [ 'value', '1', 'managedBy' ],
description: 'ID of the resource that manages this resource.' },
{ code: 'OBJECT_ADDITIONAL_PROPERTIES',
params: [ [ 'resourceGroup' ] ],
message: 'Additional properties not allowed: resourceGroup',
path: [ 'value', '0' ],
description: 'Information about appliance definition.' },
{ code: 'INVALID_TYPE',
params: [ 'string', 'null' ],
message: 'Expected type string but found type null',
path: [ 'value', '0', 'properties', 'lockLevel' ],
description: 'The appliance lock level.' },
{ code: 'ENUM_MISMATCH',
params: [ null ],
message: 'No enum match for: null',
path: [ 'value', '0', 'properties', 'lockLevel' ],
description: 'The appliance lock level.' },
{ code: 'INVALID_TYPE',
params:
[ { '$ref': '$["innerErrors"][0]["errors"][3]["params"][0]' },
'null' ],
message: 'Expected type array,boolean,number,object,string but found type null',
path: [ 'value', '0', 'tags' ],
description: 'Resource tags' },
{ code: 'INVALID_TYPE',
params: [ 'string', 'null' ],
message: 'Expected type string but found type null',
path: [ 'value', '0', 'managedBy' ],
description: 'ID of the resource that manages this resource.' } ],
message: 'Invalid body: Value failed JSON Schema validation',
path: [] } ] }
```

```
error: Found errors in validating the response with statusCode "200" for x-ms-example "Lists appliances" in operation "Appliances_ListByResourceGroup".:

{ code: 'RESPONSE_VALIDATION_ERROR',
message: 'Found errors in validating the response with statusCode "200" for x-ms-example "Lists appliances" in operation "Appliances_ListByResourceGroup".',
innerErrors:
[ { code: 'INVALID_RESPONSE_BODY',
errors:
[ { code: 'OBJECT_ADDITIONAL_PROPERTIES',
params: [ [ 'resourceGroup' ] ],
message: 'Additional properties not allowed: resourceGroup',
path: [ 'value', '1' ],
description: 'Information about appliance.' },
{ code: 'INVALID_TYPE',
params: [ [ 'array', 'boolean', 'number', 'object', 'string' ], 'null' ],
message: 'Expected type array,boolean,number,object,string but found type null',
path: [ 'value', '1', 'properties', 'parameters' ],
description: 'Name and value pairs that define the appliance parameters. It can be a JObject or a well formed JSON string.' },
{ code: 'INVALID_TYPE',
params: [ [ 'array', 'boolean', 'number', 'object', 'string' ], 'null' ],
message: 'Expected type array,boolean,number,object,string but found type null',
path: [ 'value', '1', 'properties', 'outputs' ],
description: 'Name and value pairs that define the appliance outputs.' },
{ code: 'INVALID_TYPE',
params: [ [ 'array', 'boolean', 'number', 'object', 'string' ], 'null' ],
message: 'Expected type array,boolean,number,object,string but found type null',
path: [ 'value', '1', 'tags' ],
description: 'Resource tags' },
{ code: 'INVALID_TYPE',
params: [ 'string', 'null' ],
message: 'Expected type string but found type null',
path: [ 'value', '1', 'managedBy' ],
description: 'ID of the resource that manages this resource.' },
{ code: 'OBJECT_ADDITIONAL_PROPERTIES',
params: [ [ 'resourceGroup' ] ],
message: 'Additional properties not allowed: resourceGroup',
path: [ 'value', '0' ],
description: 'Information about appliance.' },
{ code: 'INVALID_TYPE',
params:
[ { '$ref': '$["innerErrors"][0]["errors"][1]["params"][0]' },
'null' ],
message: 'Expected type array,boolean,number,object,string but found type null',
path: [ 'value', '0', 'properties', 'parameters' ],
description: 'Name and value pairs that define the appliance parameters. It can be a JObject or a well formed JSON string.' },
{ code: 'INVALID_TYPE',
params:
[ { '$ref': '$["innerErrors"][0]["errors"][2]["params"][0]' },
'null' ],
message: 'Expected type array,boolean,number,object,string but found type null',
path: [ 'value', '0', 'properties', 'outputs' ],
description: 'Name and value pairs that define the appliance outputs.' },
{ code: 'INVALID_TYPE',
params:
[ { '$ref': '$["innerErrors"][0]["errors"][3]["params"][0]' },
'null' ],
message: 'Expected type array,boolean,number,object,string but found type null',
path: [ 'value', '0', 'tags' ],
description: 'Resource tags' },
{ code: 'INVALID_TYPE',
params: [ 'string', 'null' ],
message: 'Expected type string but found type null',
path: [ 'value', '0', 'managedBy' ],
description: 'ID of the resource that manages this resource.' } ],
message: 'Invalid body: Value failed JSON Schema validation',
path: [] } ] }
{ AssertionError: swagger "/home/travis/build/Azure/azure-rest-api-specs/arm-resources/managedapplications/2016-09-01-preview/swagger/managedapplications.json" contains model validation errors.
at /home/travis/build/Azure/azure-rest-api-specs/test/model.js:21:14
name: 'AssertionError',
actual: false,
expected: true,
operator: '==',
message: 'swagger "/home/travis/build/Azure/azure-rest-api-specs/arm-resources/managedapplications/2016-09-01-preview/swagger/managedapplications.json" contains model validation errors.',
generatedMessage: false }
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.