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

Incorrect MISSING_REQUIRED_PARAMETER error #204

Closed
anuchandy opened this issue Apr 1, 2020 · 2 comments
Closed

Incorrect MISSING_REQUIRED_PARAMETER error #204

anuchandy opened this issue Apr 1, 2020 · 2 comments

Comments

@anuchandy
Copy link
Member

For the following example, the validation is failing.

The example:

{
  "parameters": {
    "vaultBaseUrl": "https://myvault.vault.azure.net",
    "keyName": "hsm-mail-key",
    "restoreBlobDetails": {
      "sasTokenParameters": {
        "storageResourceUri": "https://myaccount.blob.core.windows.net/sascontainer/sasContainer",
        "token": "se=2018-02-01T00%3A00Z&spr=https&sv=2017-04-17&sr=b&sig=XXFNfuMCH112BxhemJ7PWn0xGfImMXT6LfbXWvtRUk%3D"
      },
      "folder": "mhsm-mypool-20200303062926785"
    },
    "api-version": "7.2-preview"
  },
  "responses": {
    "202": {
      "headers": {
        "Retry-After": 5,
        "Azure-AsyncOperation": "https://myvault.vault.azure.net/restore/45aacd568a23b0s49a2803861e8dd3ase21f/pending"
      },
      "body": {
        "status": "InProgress",
        "statusDetails": "Selective Key restore is in progress",
        "jobId": "45aacd568a23b0s49a2803861e8dd3ase21f",
        "startTime": 1490790000,
        "endTime": 0
      }
    }
  }
}

Error:

operationId: SelectiveKeyRestoreOperation
scenario: Selectively restore key from a backup
source: request
responseCode: ALL
severity: 0
code: MISSING_REQUIRED_PARAMETER
details:
  code: MISSING_REQUIRED_PARAMETER
  message: Value is required but was not provided
  schemaPath: '#/paths/~1keys~1{keyName}~1restore/put/parameters/0'
operationId: SelectiveKeyRestoreOperation
scenario: Selectively restore key from a backup
source: request
responseCode: ALL
severity: 0
code: MISSING_REQUIRED_PARAMETER
details:
  code: MISSING_REQUIRED_PARAMETER
  message: Value is required but was not provided
  schemaPath: '#/paths/~1keys~1{keyName}~1restore/put/parameters/3'

The swagger operation and parameters

"/keys/{keyName}/restore": {
    "put": {
    "tags": [
        "Keys"
    ],
    "operationId": "SelectiveKeyRestoreOperation",
    "parameters": [
        {
        "name": "keyName",
        "in": "path",
        "required": true,
        "type": "string",
        },
        {
        "name": "restoreBlobDetails",
        "in": "body",
        "schema": {
            "$ref": "#/definitions/SelectiveKeyRestoreOperationParameters"
        },
        },
        {
        "$ref": "#/parameters/ApiVersionParameter"
        }
    ],
    "responses": {
        "202": {
        "headers": {
            "Retry-After": {
            "type": "integer"
            },
            "Azure-AsyncOperation": {
            "type": "string"
            }
        },
        "schema": {
            "$ref": "#/definitions/SelectiveKeyRestoreOperation"
        }
        },
        "default": {
        "schema": {
            "$ref": "common.json#/definitions/KeyVaultError"
        }
        }
    },
    "x-ms-examples": {
        "Selectively restore key from a backup": {
        "$ref": "./examples/SelectiveRestore-example.json"
        }
    }
    }
}
"parameters": {
    "ApiVersionParameter": {
      "name": "api-version",
      "in": "query",
      "required": true,
      "type": "string",
      "description": "Client API version."
    }
  }
"SelectiveKeyRestoreOperationParameters": {
    "properties": {
    "sasTokenParameters": {
        "$ref": "#/definitions/SASTokenParameter"
    },
    "folder": {
        "type": "string",
    }
    },
    "required": [
        "folder",
        "sasTokenParameters"
    ]
},
"SASTokenParameter": {
    "properties": {
    "storageResourceUri": {
        "type": "string",
    },
    "token": {
        "type": "string",
    }
    },
    "required": [
        "storageResourceUri",
        "token"
    ]
},
@anuchandy
Copy link
Member Author

This is reported for the pull request: Azure/azure-rest-api-specs#8781

A PR with a similar error was overridden and merged in the past: Azure/azure-rest-api-specs#8622

@jianyexi
Copy link
Contributor

jianyexi commented Aug 3, 2020

This is an oav issue which should be sent to the https://github.com/Azure/oav

@jianyexi jianyexi closed this as completed Aug 3, 2020
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

No branches or pull requests

2 participants