Provide a stripped down library for just the simplest object support

Issue #422 resolved
MikeL created an issue

Currently, when trying to use snakeyaml in our application with a minimal JRE 10 it fails because java.sql.Date is required (though not used by our application).

I would appreciate it to have a stripped down snakeyaml library that only supports the core objects like json-simple (primitives, List, Map) and move all the other, more advanced stuff to a separate library.

Comments (13)

  1. MikeL reporter

    I'm using SnakeYAML 1.1 and according to my knowledge SQL is not part of SnakeYAML, so it should not have a dependency on it - especially where Java 9+ allows to create stripped down JREs. Of course, it would be possible to add the SQL dependency to our project's JRE, but this sounds odd to me if it is just to make a third-party library happy without actually using any SQL/database code.

  2. Andrey Somov

    SnakeYAML supports Java 6 and java.sql is part of JDK 6. java.sql was included because SnakeYAML must parse !!timestamp tag, which is a part of YAML 1.1 spec. Removing java.sql would break backwards compatibility.

    What is the reason not to switch to SnakeYAML engine and get support for YAML 1.2 ?

  3. MikeL reporter

    Thank you for the explanation. Regarding the timestamp tag - why this is no java.util.Date, but a java.sql.Date (except of backward compatibility)?

    I have used SnakeYAML instead of SnakeYAML Engine because it provides all what we need (and even more) and seems to actively been developed. I'll give SnakeYAML Engine a try.

  4. MikeL reporter

    OK, I have switched now to SnakeYAML Engine and it works fine without the java.sql.Date dependency.

    Thank you very much for your effort and the support in this ticket which now became obsolete.

  5. Andrey Somov

    Do you work on an OpenSource project ? Can you share your experience in a blog to help others to migrate to SnakeYAML Engine ?

  6. MikeL reporter

    I'm not opening on OpenSource projects, but I'm happy to share my positive experience with SnakeYAML Engine.

  7. Andrey Somov

    I mean if you can expose the instructions to migrate you can save a lot of time for other users.

  8. Baptiste Mathus

    Hello! Thanks a lot for this fix! As far as I understand, this fix is not in a released version yet. Would be great if we can get a release out.

    Thanks again!

  9. Log in to comment