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

Example type verification for sub-object errors with INVALID_TYPE #992

Open
scbedd opened this issue Aug 14, 2023 · 0 comments
Open

Example type verification for sub-object errors with INVALID_TYPE #992

scbedd opened this issue Aug 14, 2023 · 0 comments
Assignees

Comments

@scbedd
Copy link
Member

scbedd commented Aug 14, 2023

This seemingly occurs where we define the type of a containing object, but not the individual properties within.

Specific Build Log Line

Error Detail:

{
  code: 'INVALID_TYPE',
  message: 'Expected type object but found type integer',
  schemaUrl: 'specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/DatabaseAdvisors.json',
  exampleUrl: 'specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/DatabaseRecommendedActionListExpand.json',
  schemaPosition: { line: 409, column: 35 },
  schemaJsonPath: '#/properties/details/additionalProperties/type',
  examplePosition: { line: 602, column: 38 },
  exampleJsonPath: "$responses.200.body[3].properties.recommendedActions[0].properties.details['sqlErrorCount']",
  severity: 0,
  source: 'response',
  operationId: 'DatabaseAdvisors_ListByDatabase',
  level: '\x1B[31merror\x1B[39m'
}

Here is the schema detail:

        "details": {
          "description": "Gets additional details specific to this recommended action.",
          "type": "object",
          "additionalProperties": {
            "type": "object"
          },
          "readOnly": true
        }

With example:

                  "details": {
                    "sqlErrorNumber": 208,
                    "sqlErrorMessage": "Invalid object name 'dbo.Companies'.",
                    "sqlErrorCount": 342482
                  }

As one can see, we are throwing on sqlErrorCount not being a string. Even though we never defined what those properties would be.

Repro Branch

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

1 participant