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

Tracking issue for YAML 1.2 emitter support #484

Open
3 of 4 tasks
am11 opened this issue Apr 27, 2020 · 4 comments
Open
3 of 4 tasks

Tracking issue for YAML 1.2 emitter support #484

am11 opened this issue Apr 27, 2020 · 4 comments

Comments

@am11
Copy link
Contributor

am11 commented Apr 27, 2020

YDN v8.1.1+ support scanning and parsing of YAML 1.2 documents by the spec. This is indicated in the repo's README.

This issue is to track support for YAML 1.2 for emitter and (JSON) serializer.

As a prerequisite cleanup, I propose to refactor some bits for better diagnosability and facilitating emitter spec testing:

  • Move libyaml event stream in its own emitter, so existing parser spec test runner and yaml-runtime can share it:
    private static void ConvertToLibYamlStyleAnnotatedEventStream(TextReader textReader, TextWriter textWriter)
  • Extract spec suite directory discovery into utilities.
  • Rename SpecTests.cs to something like ParserSpecTests.cs.

after that:

  • Add EmitterSpecTests.cs with execution, assertions and ignore lists.

After the initial bootstrapping of emitter test runner, add the list of failing tests below this line for tracking.

TODO: add list

@aaubry
Copy link
Owner

aaubry commented Apr 27, 2020

This looks good. FYI, I'm currently working on implementing schemas, based on the 1.2 spec. This may be relevant for this work.

@am11
Copy link
Contributor Author

am11 commented Apr 28, 2020

Cool, looking forward to it. 🙂
I haven't' looked much deeper but I think we have some spec tests validating schema on emitter side.

After the #485 refactoring, I will switch to working on emitter spec tests execution.

@bootzin
Copy link

bootzin commented Dec 5, 2020

How's the progress on this?

@am11
Copy link
Contributor Author

am11 commented Dec 5, 2020

@bootzin, spec suite for emitters was configured in master branch, such that anyone can contribute to improve the coverage and de-ignore the related specs.

private static readonly List<string> ignoredSuites = new List<string>

My last work in progress for emitters was a scenario which we do not currently support (for 1.1 either): "end-to-end (roundtripable) mapping of anchors". We have added support for anchor deserialization in #490. However, for serialization, preserving anchor E2E becomes quite complicated and expensive in terms of performance (hint; reflection and bookkeeping of complex object graphs), code complexity and maintenance.. unless we add support for C# 9 code generators or some such.

Also, I am not sure how valuable is it in real world? One of the Ruby based YAML library used to have this kind of anchor serialization support, but they removed it (probably it was deemed not worth the effort?)

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

3 participants