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

can't parse yaml spec due to ref resolution in external files #81

Closed
marina-p opened this issue Nov 20, 2020 · 0 comments · Fixed by #83
Closed

can't parse yaml spec due to ref resolution in external files #81

marina-p opened this issue Nov 20, 2020 · 0 comments · Fixed by #83
Assignees
Labels
external External issues in dependencies.

Comments

@marina-p
Copy link
Contributor

See issue #74. This is due to an underlying issue in the NJsonSchema library parsing external references. This is already being worked around for json by preprocessing and inlining external refs. The same workaround needs to be implemented for yaml.

Unhandled exception. System.AggregateException: One or more errors occurred. (Could not resolve the JSON path 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' with the full JSON path '/home/vmuser/5GC_APIs/TS29571_CommonData.yaml#/components/schemas/LinksValueSchema'.)
---> System.InvalidOperationException: Could not resolve the JSON path 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' with the full JSON path '/home/vmuser/5GC_APIs/TS29571_CommonData.yaml#/components/schemas/LinksValueSchema'.
---> System.InvalidOperationException: Could not resolve the path '#/components/schemas/LinksValueSchema'.
at NJsonSchema.JsonReferenceResolver.ResolveDocumentReference(Object rootObject, String jsonPath)
at NJsonSchema.JsonReferenceResolver.ResolveReferenceAsync(Object rootObject, String jsonPath, Boolean append)
at NJsonSchema.JsonReferenceResolver.ResolveReferenceAsync(Object rootObject, String jsonPath)
at NJsonSchema.JsonReferenceResolver.ResolveFileReferenceWithAlreadyResolvedCheckAsync(String fullJsonPath, String jsonPath, Boolean append)
--- End of inner exception stack trace ---

@marina-p marina-p changed the title can't parse yaml spec due to ref resolution can't parse yaml spec due to ref resolution in external files Nov 20, 2020
@marina-p marina-p self-assigned this Nov 20, 2020
@marina-p marina-p added the external External issues in dependencies. label Nov 21, 2020
marina-p added a commit that referenced this issue Nov 21, 2020
The fix is to inline all external references, same as already done
for json specs.

Convert the spec to json and use the existing logic.

Closes #81.
marina-p added a commit that referenced this issue Nov 21, 2020
The fix is to inline all external references, same as already done
for json specs.

Convert the spec to json and use the existing logic.

Closes #81.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external External issues in dependencies.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant