Fixed nullable value bug (#511)
* Fixed nullable value bug Avoid adding nullable value for parameter when its' type isn't string.
This commit is contained in:
Родитель
8de3343464
Коммит
46f761f01a
|
@ -1,6 +1,11 @@
|
|||
# Changelog
|
||||
|
||||
## 04/10/2020 0.21.5
|
||||
## 05/21/2020 0.21.6
|
||||
|
||||
- Avoid adding nullable value for parameter when its' type isn't string
|
||||
- Output exception infomation for semantic validation
|
||||
|
||||
## 04/20/2020 0.21.5
|
||||
|
||||
- Output exception information when pretty switch is enabled.
|
||||
|
||||
|
|
|
@ -647,7 +647,7 @@ export function allowNullableParams(parameter: ParameterObject): ParameterObject
|
|||
if (parameter.in && parameter.in === "body" && parameter.schema) {
|
||||
parameter.schema = allowNullableTypes(parameter.schema)
|
||||
} else {
|
||||
if (parameter.in && parameter.in !== "path") {
|
||||
if (parameter.in && parameter.in !== "path" && parameter.type === "string") {
|
||||
parameter = allowNullType(parameter, parameter.required)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "oav",
|
||||
"version": "0.21.5",
|
||||
"version": "0.21.6",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "oav",
|
||||
"version": "0.21.5",
|
||||
"version": "0.21.6",
|
||||
"author": {
|
||||
"name": "Microsoft Corporation",
|
||||
"email": "azsdkteam@microsoft.com",
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"parameters": {
|
||||
"serviceName": "sampleServiceName",
|
||||
"isGroupbySite": true,
|
||||
"takeCount": "1",
|
||||
"takeCount": "string",
|
||||
"nextPartitionKey": " ",
|
||||
"nextRowKey": " ",
|
||||
"api-version": "2014-01-01"
|
||||
|
@ -10,80 +10,80 @@
|
|||
"responses": {
|
||||
"200": {
|
||||
"body": {
|
||||
"value": [
|
||||
{
|
||||
"domainName": "sampleDomainName",
|
||||
"siteName": "Default-First-Site-Name",
|
||||
"addsRoles": [
|
||||
"sampleRole"
|
||||
],
|
||||
"gcReachable": true,
|
||||
"isAdvertising": true,
|
||||
"pdcReachable": true,
|
||||
"sysvolState": true,
|
||||
"dcTypes": [
|
||||
"GC"
|
||||
],
|
||||
"lastReboot": "2018-04-28T23:17:00.511864Z",
|
||||
"lastDisabled": "2018-04-28T23:17:00.511864Z",
|
||||
"lastUpdated": "2018-04-30T18:00:41.6956022Z",
|
||||
"activeAlerts": 0,
|
||||
"resolvedAlerts": 0,
|
||||
"createdDate": "2018-04-28T23:17:00.511864Z",
|
||||
"disabled": false,
|
||||
"dimensions": [
|
||||
{
|
||||
"key": "key1",
|
||||
"value": "value1"
|
||||
}
|
||||
],
|
||||
"additionalInformation": "SampleAdditionalInformation",
|
||||
"tenantId": "00000000-0000-0000-0000-000000000000",
|
||||
"serviceId": "serviceIdGuid",
|
||||
"serviceMemberId": "ServiceMemberIdGuid",
|
||||
"machineId": "machineIdGuid",
|
||||
"machineName": "sampleMachineName",
|
||||
"role": "SampleRole",
|
||||
"status": "Healthy",
|
||||
"properties": [
|
||||
{
|
||||
"key": "key1",
|
||||
"value": "value1"
|
||||
}
|
||||
],
|
||||
"installedQfes": [{
|
||||
"value": [
|
||||
{
|
||||
"domainName": "sampleDomainName",
|
||||
"siteName": "Default-First-Site-Name",
|
||||
"addsRoles": ["sampleRole"],
|
||||
"gcReachable": true,
|
||||
"isAdvertising": true,
|
||||
"pdcReachable": true,
|
||||
"sysvolState": true,
|
||||
"dcTypes": ["GC"],
|
||||
"lastReboot": "2018-04-28T23:17:00.511864Z",
|
||||
"lastDisabled": "2018-04-28T23:17:00.511864Z",
|
||||
"lastUpdated": "2018-04-30T18:00:41.6956022Z",
|
||||
"activeAlerts": 0,
|
||||
"resolvedAlerts": 0,
|
||||
"createdDate": "2018-04-28T23:17:00.511864Z",
|
||||
"disabled": false,
|
||||
"dimensions": [
|
||||
{
|
||||
"key": "key1",
|
||||
"value": "value1"
|
||||
}
|
||||
],
|
||||
"additionalInformation": "SampleAdditionalInformation",
|
||||
"tenantId": "00000000-0000-0000-0000-000000000000",
|
||||
"serviceId": "serviceIdGuid",
|
||||
"serviceMemberId": "ServiceMemberIdGuid",
|
||||
"machineId": "machineIdGuid",
|
||||
"machineName": "sampleMachineName",
|
||||
"role": "SampleRole",
|
||||
"status": "Healthy",
|
||||
"properties": [
|
||||
{
|
||||
"key": "key1",
|
||||
"value": "value1"
|
||||
}
|
||||
],
|
||||
"installedQfes": [
|
||||
{
|
||||
"kbName": "KB3019978",
|
||||
"link": "SampleLink",
|
||||
"installedDate": "2016-11-06T04:00:00Z"
|
||||
}],
|
||||
"recommendedQfes": [{
|
||||
}
|
||||
],
|
||||
"recommendedQfes": [
|
||||
{
|
||||
"kbName": "KB3019978",
|
||||
"link": "SampleLink",
|
||||
"installedDate": "2016-11-06T04:00:00Z"
|
||||
}],
|
||||
"monitoringConfigurationsComputed": [
|
||||
{
|
||||
"key": "key1",
|
||||
"value": "value1"
|
||||
}
|
||||
],
|
||||
"monitoringConfigurationsCustomized": [
|
||||
{
|
||||
"key": "key1",
|
||||
"value": "value1"
|
||||
}
|
||||
],
|
||||
"osVersion": "osVersion",
|
||||
"osName": "osName",
|
||||
"disabledReason": 0,
|
||||
"serverReportedMonitoringLevel": "Off",
|
||||
"lastServerReportedMonitoringLevelChange": "2018-04-30T18:00:41.6956022Z"
|
||||
}
|
||||
],
|
||||
"nextLink": null,
|
||||
"totalCount": 0,
|
||||
"continuationToken": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"monitoringConfigurationsComputed": [
|
||||
{
|
||||
"key": "key1",
|
||||
"value": "value1"
|
||||
}
|
||||
],
|
||||
"monitoringConfigurationsCustomized": [
|
||||
{
|
||||
"key": "key1",
|
||||
"value": "value1"
|
||||
}
|
||||
],
|
||||
"osVersion": "osVersion",
|
||||
"osName": "osName",
|
||||
"disabledReason": 0,
|
||||
"serverReportedMonitoringLevel": "Off",
|
||||
"lastServerReportedMonitoringLevelChange": "2018-04-30T18:00:41.6956022Z"
|
||||
}
|
||||
],
|
||||
"nextLink": null,
|
||||
"totalCount": 0,
|
||||
"continuationToken": null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,8 @@ describe("sourceMap", () => {
|
|||
assert.strictEqual(result.length, 1)
|
||||
const result0 = result[0]
|
||||
const e = result0.details as any
|
||||
assert.strictEqual(e.url, file)
|
||||
assert.deepStrictEqual(e.position, { line: 76, column: 11 })
|
||||
assert.strictEqual(e.jsonPath, "$.parameters.takeCount")
|
||||
assert.strictEqual(e.code, "INVALID_TYPE")
|
||||
assert.strictEqual(e.message, "Expected type integer but found type string")
|
||||
})
|
||||
})
|
||||
|
|
Загрузка…
Ссылка в новой задаче