Skip to content

Add JSON Comment support - #1112

Open
DavidBerg-MSFT wants to merge 1 commit into
aaubry:masterfrom
DavidBerg-MSFT:master
Open

Add JSON Comment support#1112
DavidBerg-MSFT wants to merge 1 commit into
aaubry:masterfrom
DavidBerg-MSFT:master

Conversation

@DavidBerg-MSFT

Copy link
Copy Markdown

First attempt at basic JSON comment support. Currently only supports // and not /* also causes problems with existing unquoted scalars (like https://my.org), which I intend to fix, but I wanted to post what I have so far and get your feedback, so I can incorporate into future updates.

See Yaml.Org Issue 196 for relevant discussion on how best to address the unquoted scalar issue (also YamlDotNet issue 1052).

Mode Switch

Currently governed by a Scanner.JsonComments bool property to turn on/off. This works for testing, but probably not ideal for plumbing all the way up. Preferences welcome.

Unit Tests

I added clones of the existing comment unit tests, but clearly additional tests will be necessary to handle the edge cases (see Yaml.Org Issue 196).

I'm seeing failures in the ConformsWithYamlSpec tests, "System.InvalidOperationException : No data found for YamlDotNet.Test.Spec.ParserSpecTests.ConformsWithYamlSpec". Those failures are occurring with and without my changes, so I'm ignoring them for now; however, if there's something I can do to make those tests work, please let me know.

Other

I'm generally trying to follow the contribution guidelines, if I missed anything, please let me know.

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

Successfully merging this pull request may close these issues.

1 participant