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

OAV not reporting example position for INVALID_TYPE error in request #423

Closed
veronicagg opened this issue Apr 30, 2019 · 4 comments
Closed
Assignees

Comments

@veronicagg
Copy link
Contributor

https://github.com/Azure/azure-rest-api-specs/blob/f9f5d84cf22d860a02fb3188a58863c4241a89b6/specification/adhybridhealthservice/resource-manager/Microsoft.ADHybridHealthService/stable/2014-01-01/ADHybridHealthService.json

Output contains an INVALID_TYPE error in the REQUEST and points to the spec but not the corresponding position in the example
Details:
Show inner error
Details: "Expected type object but found type array"
Spec location: specification/adhybridhealthservice/resource-manager/Microsoft.ADHybridHealthService/stable/2014-01-01/ADHybridHealthService.json#L6213

Operation ID - addsServices_update
Scenario = addsServices_update
Source= request
ErrorCode INVALID_TYPE

@raych1
Copy link
Contributor

raych1 commented Jul 4, 2019

@veronicagg here're the detail error message. It's clear to see the complained parameter name is 'service' though it doesn't have the line number of the example file. I would say won't fix.
@amarzavery @sergey-shandar , do you have any comment on this issue?

 code: 'REQUEST_VALIDATION_ERROR',
  id: 'OAV109',
  message:
   'Found errors in validating the request for x-ms-example "addsServices_update" in operation "addsServices_update".:\nFound errors in validating the request for x-ms-example "addsServices_update" in operation "addsServices_update".',
  innerErrors:
   [ { code: 'INVALID_REQUEST_PARAMETER',
       errors:
        [ { code: 'INVALID_TYPE',
            params: [ 'object', 'array' ],
            message: 'Expected type object but found type array',
            path: [],
            title:
             '{"path":["definitions","ServiceProperties"],"position":{"line":6213,"column":26},"url":"D:/git/github/azure-rest-api-specs/specification/adhybridhealthservice/resource-manager/Microsoft.ADHybridHealthService/stable/2014-01-01/ADHybridHealthService.json","directives":{}}',
            description: 'The service properties for a given service.' } ],
       in: 'body',
       message:
        'Invalid parameter (service): Value failed JSON Schema validation',
       name: 'service',
       schemaPath:
        '#/paths/~1providers~1Microsoft.ADHybridHealthService~1addsservices~1{serviceName}/patch/parameters/1' } ],
  level: '\u001b[31merror\u001b[39m' }

@sergey-shandar
Copy link
Contributor

sergey-shandar commented Jul 4, 2019

@raych1 this issue is important one because it's hard for users to see where the problem is. Also OpenAPI Hub will not show a link to example error as well @vladbarosan @billytrend.

@vladbarosan
Copy link

vladbarosan commented Jul 8, 2019

@sergey-shandar , @raych1 correct, the hub wont be able to show a link without the source location

@raych1
Copy link
Contributor

raych1 commented Mar 20, 2020

Closed as the fix was merged.

@raych1 raych1 closed this as completed Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants