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

unhelpful error when referenced file not found or empty #444

Closed
ctaggart opened this issue Jul 18, 2019 · 2 comments
Closed

unhelpful error when referenced file not found or empty #444

ctaggart opened this issue Jul 18, 2019 · 2 comments

Comments

@ctaggart
Copy link

I'm working on Azure/azure-rest-api-specs#6653 by adding examples. I've started adding the x-ms-examples. I create the blank examples and ran this tool. It was not helpful:

root@7fe462c08598:/src# oav validate-spec vmwarevirtustream.json
{ level: '\u001b[31merror\u001b[39m' }
{ message:
   'RESOLVE_SPEC_ERROR: internal error: Cannot read property \'Symbol(@ts-common/source-map/object-info)\' of null.',
  level: '\u001b[31merror\u001b[39m' }
{ message: undefined, level: '\u001b[31merror\u001b[39m' }
{ message:
   'fatal error: internal error: Cannot read property \'Symbol(@ts-common/source-map/object-info)\' of null, {"code":"INTERNAL_ERROR","id":"OAV100","message":"internal error: Cannot read property \'Symbol(@ts-common/source-map/object-info)\' of null","innerErrors":[{"message":"internal error: Cannot read property \'Symbol(@ts-common/source-map/object-info)\' of null","code":"INTERNAL_ERROR","id":"OAV100","innerErrors":[{"level":"error"}]}]}',
  level: '\u001b[31merror\u001b[39m' }
fatal error: internal error: Cannot read property 'Symbol(@ts-common/source-map/object-info)' of null, {"code":"INTERNAL_ERROR","id":"OAV100","message":"internal error: Cannot read property 'Symbol(@ts-common/source-map/object-info)' of null","innerErrors":[{"message":"internal error: Cannot read property 'Symbol(@ts-common/source-map/object-info)' of null","code":"INTERNAL_ERROR","id":"OAV100","innerErrors":[{"level":"error"}]}]}

I was expecting to give more useful error information like :

root@7fe462c08598:/src# autorest --input-file=vmwarevirtustream.json --azure-validator --openapi-type=arm
AutoRest code generation utility [version: 2.0.4283; node: v10.16.0]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
   Loading AutoRest core      '/root/.autorest/@[email protected]/node_modules/@microsoft.azure/autorest-core/dist' (2.0.4387)
   Loading AutoRest extension '@microsoft.azure/classic-openapi-validator' (~1.0.9->1.0.14)
   Loading AutoRest extension '@microsoft.azure/openapi-validator' (~1.0.2->1.0.4)
ERROR: Referenced file 'file:///src/examples/PrivateCloud_MoveResources.json' not found
    - file:///src/vmwarevirtustream.json:1183:12 ($.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources"].post["x-ms-examples"].PrivateCloud_MoveResources["$ref"])
FATAL: swagger-document/loader - FAILED
FATAL: Error: [OperationAbortedException] Error occurred. Exiting.
Process() cancelled due to exception : [OperationAbortedException] Error occurred. Exiting.
@raych1
Copy link
Member

raych1 commented Jul 21, 2019

@ctaggart, what blank example do you mean? Does it like below?

{
  "parameters": {
    "subscriptionId": "{subscription-id}",
    "api-version": "2016-09-01-preview"
  },
  "responses": {}
}

@raych1
Copy link
Member

raych1 commented Sep 3, 2019

@ctaggart, I cannot repro this issue with blank example. The error above you mentions is for sematic validation instead of model validation. I close this issue for now and please feel free to re-open it if you still see this issue.

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