-
Notifications
You must be signed in to change notification settings - Fork 146
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
Implicit types are not supported #7
Comments
From nathan.s...@gmail.com on February 16, 2011 22:32:43 I don't believe guessing at the type based on the content is a good idea in general. It is less important for YamlBeans, where typically YAML is deserialized to objects, where the class definition is used for the schema. Primitive type wrappers are expressed as null by a YAML field with an empty value. There is currently no way to express a null for other references. I will open a new issue as a task to add support for a !null tag. Slightly more info in this thread: Status: WontFix |
From py4fun@gmail.com on February 17, 2011 01:53:58 It is not guessing it is defining. When you wish '1' to be a String instead of an integer you say !!str "1". |
From nathan.s...@gmail.com on February 17, 2011 02:04:25 YamlBeans' goal is to go from Java objects to YAML and vice versa using the minimal YAML markup. Type definitions come from the Java class definition, not from the YAML markup. Even if it did not conflict with YamlBeans' goals, implicit typing is a bad idea. This could be why it appears to be removed from the YAML 1.2 specification. |
From py4fun@gmail.com on February 17, 2011 04:05:32 It stays in YAML 1.2 ! But fortunately, it was dramatically reduced. |
From nathan.s...@gmail.com on February 17, 2011 04:26:58 At the top of the 1.2 spec it says, "We have removed unique implicit typing rules and have updated these rules to align them with JSON's productions." You linked to section "10. Recommended Schemas". Again, YamlBeans uses the Java class definition as the schema. YamlBeans has no need for guessing at types using regex or verbose type tags. Again, YamlBeans is for Java to YAML to Java with minimal YAML markup. It is not for cross-platform data exchange. I do not care if YamlBeans does not implement optional portions of the spec. In fact, the specs' complexity is the reason that YAML will never see widespread adoption. Writing a parser is simply too hard. You are the SnakeYAML author. You are not a user of YamlBeans. If you were, you'd be pleased that YamlBeans does what it intends to do (do I really need to repeat it again?) with an elegant API, tailored specifically for that purpose. If you need features beyond what YamlBeans was intended for, then I suggest using a different library, where you will pay the cost of a more complex API and uglier YAML markup. |
From py4fun@gmail.com on February 17, 2011 05:46:32 At the top of the 1.2 spec it says, "We have removed UNIQUE implicit typing rules and have updated these rules to align them with JSON's productions.". It used to have 18 (!) values boolean but it is only 2 in 1.2. This is better. |
From nathan.s...@gmail.com on February 17, 2011 15:12:37 YamlBeans users don't try to use optional features. They have no need to. You are trying use cases that are atypical for YamlBeans users. YamlBeans is a source directory containing Java files. You can compile it with Maven, Ant, Scar, Netbeans, Eclipse, javac, etc. There is nothing special about compiling it. You can also use the provided JAR. My issue with your comparison page in the past is that you use it to sell your library while spreading FUD about other libraries. Potential users should choose a library on their actual merits. We have all worked hard on our libraries and it isn't right for them to be misrepresented. This can occur even when the facts are correct. It would be easy to make it appear that one library is better than others by using careful comparison tables and commentary. Having spoken with you publicly and privately over the past almost 3 years, I don't know you are capable of an unbiased comparison. Working together with you has failed in the past and I see no reason why this would be different. YamlBeans excels at serializing Java objects to YAML and back using minimal YAML markup and an easy to use API. YamlBeans can parse YAML from other sources to Java objects, but because this is not its primary goal, some of the more esoteric features from the YAML specification may not be supported. If would be nice if this is conveyed in your comparison page. It might make sense to have code snippets showing how Java objects are round tripped, along with what the YAML looks like. It shouldn't be hard to have something good to say about each library. |
From py4fun@gmail.com on January 28, 2011 13:04:41
The following YAML:
...
returns a list of strings instead of a list of integers.
Another example:
!com.package.MyStuff
id: id123
name: foo
bar: null
...
The 'bar' property gets 'null' as literal String("null") and not as a null reference.
Original issue: http://code.google.com/p/yamlbeans/issues/detail?id=7
The text was updated successfully, but these errors were encountered: