Closed GoogleCodeExporter closed 9 years ago
The spec:
If a document contains unresolved tags, the YAML processor is unable to compose
a
complete representation graph. In such a case, the YAML processor may compose an
partial representation, based on each node’s kind and allowing for
non-specific tags.
http://yaml.org/spec/1.1/#partial%20representation/
A complete representation is required in order to construct native data
structures.
It is the same as if you define a local tag with the meaning: "!Place" ->
"!!str"
I am not really in favour of simply ignoring tags. But I will have a look how an
application can specify a flexible "tag policy" with minimum code.
Original comment by aso...@gmail.com
on 13 Nov 2009 at 5:38
I agree that ignoring tags should not be default behaviour. In my case, the
data in
the files is presented to the user (after some processing). For the
presentation its
not so important that the construction produces the right classes.
Just adding "!Place" -> "!!str" does not help in my particular case. I cannot
control
what tags are used in the input files.
I'd implement it my self, but I don't want to mess with Constructor class
without
your guidance.
Original comment by smurn....@gmail.com
on 13 Nov 2009 at 7:33
If it not important that the construction produces the right classes can you
just
create nodes ?
(http://code.google.com/p/snakeyaml/wiki/Documentation#Low_Level_API)
I still do not get how to define:
- which tags should be ignored
- which tags must be respected
- which tags must cause a failure if they cannot be properly processed
If the tag is ignored, should the implicit types be respected ? (123 -> Integer)
The term "unknown tag" is unclear for me since a local tag can be defined in
the
document. I think you are only talking about the global tags (with the class
name).
But then the example is not very representative.
Original comment by py4fun@gmail.com
on 16 Nov 2009 at 9:46
I have to read data structures that were serialized by another application. I
have
some classes (the ones I care about) that I know are part of both apps. So those
could be constructed during loading. For all the other classes its enough if I
can
make a nice print-out of the data. So my idea was to simply use the default
str, map,
seq types for them.
I see now that this was a bad idea. The main problem is that the default str
map seq
types will not be assignable to my bean properties because they use
incompatible data
types.
Unless you come up with some better idea I suggest closing this issue.
Seems I have to manually extract the data I need from the Low level API after
all.
Original comment by smurn....@gmail.com
on 22 Nov 2009 at 4:02
Original comment by py4fun@gmail.com
on 23 Nov 2009 at 8:44
Original issue reported on code.google.com by
smurn....@gmail.com
on 13 Nov 2009 at 4:10