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

OpenApiStringReader bubbles parsing error for valid JSON document #266

Open
scott-lin opened this issue May 31, 2018 · 2 comments
Open

OpenApiStringReader bubbles parsing error for valid JSON document #266

scott-lin opened this issue May 31, 2018 · 2 comments
Assignees
Labels
status:waiting-for-internal-feedback Needs internal stakeholder(s) input to resolve

Comments

@scott-lin
Copy link
Contributor

The following document produces a parsing error due to the backslash in the basePath property. It is valid JSON, however, so I feel like the library should handle this without error. I believe this is a limitation/bug in SharpYaml parser being used within OpenAPI.NET.

Document

{
	"swagger": "2.0",
	"info": {
		"title": "This is a simple example",
		"version": "1.0.0"
	},
	"host": "example.org",
	"basePath": "\/api",
	"schemes": [
		"http",
		"https"
	],
	"paths": {}
}

Repro Code

var openApiStringReader = new OpenApiStringReader();
OpenApiDocument openApiDocument = openApiStringReader.Read( serializedDocument, out OpenApiDiagnostic openApiDiagnostic );

Error from OpenApiDiagnostic
(Lin: 7, Col: 13, Chr: 140) - (Lin: 7, Col: 14, Chr: 141): While parsing a quoted scalar, find unknown escape character.

@darrelmiller
Copy link
Member

This is a new escape character in Yaml 1.2. I will create a PR in SharpYaml to add support for it.

@darrelmiller darrelmiller self-assigned this Jun 21, 2018
@adhiambovivian adhiambovivian added the status:waiting-for-internal-feedback Needs internal stakeholder(s) input to resolve label Apr 4, 2023
@darrelmiller
Copy link
Member

We should retest this bug to see if latest versions of YamlSharp address this. /cc @MaggieKimani1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:waiting-for-internal-feedback Needs internal stakeholder(s) input to resolve
Projects
None yet
Development

No branches or pull requests

4 participants