Commit graph

133 commits

Author SHA1 Message Date
Masaaki Goshima
3b6beba689
fix flow sequence with map (#620) 2025-01-18 00:34:00 +09:00
Masaaki Goshima
4260634dc8
Fix tag with flow sequence (#618)
* fix tag with flow sequence

* fix lint error
2025-01-16 19:25:38 +09:00
Masaaki Goshima
e2e4400472
fix sequence value for merge key (#603) 2024-12-22 19:43:53 +09:00
Masaaki Goshima
aeed806d55
Fix cast process for decoding of anchor value (#602)
* add test case

* fix cast process for decoding of anchor value
2024-12-21 21:50:58 +09:00
Masaaki Goshima
7d56fe29f3
support merge tag (#597) 2024-12-18 10:32:00 +09:00
Oleksandr Redko
7601ad3fe8
Fix displaying testable example on pkg.go.dev (#587) 2024-12-13 09:27:52 +09:00
Oleksandr Redko
342293d734
Replace fmt.Sprint with faster alternatives (#555) 2024-12-13 00:31:35 +09:00
Masaaki Goshima
2ab584e0fa
support utf-16 surrogate pair (#564) 2024-12-02 11:30:11 +09:00
Masaaki Goshima
bf03d4d7b1
fix escape character in double-quote (#562) 2024-12-01 21:26:13 +09:00
Masaaki Goshima
c5254d7cf4
Fix parser (#554)
* add "no json" marker

* fix document separator in quote

* fix invalid escape character

* fix parser
2024-11-30 10:16:17 +09:00
Masaaki Goshima
c3128820b1
Add YAML Test Suite (#541)
* add yaml-test-suite

* add threshold to prevent degrade

* remove recursive option from test

* move test file

* fix lint error

* exclude windows
2024-11-16 12:52:29 +09:00
Masaaki Goshima
9c6665c9b4
support to disallow duplicate map key at parsing (#531) 2024-11-13 18:29:20 +09:00
Masaaki Goshima
cb4e1b0610
Support local tag and boolean tag (#527)
* support local tag and boolean tag

* add test case
2024-11-13 00:40:31 +09:00
Masaaki Goshima
29b57b4cc6
fix trailing new line chars handling (#507) 2024-11-06 12:48:45 +09:00
Masaaki Goshima
e27add428c
fix invalid alias (#497) 2024-11-02 17:40:43 +09:00
Masaaki Goshima
af5147b14c
fix implicit null value before collect entry (#490) 2024-10-30 19:48:44 +09:00
Masaaki Goshima
950afad7c7
support recursive anchor (#489) 2024-10-30 19:25:18 +09:00
Masaaki Goshima
548bbc7d4e
Remove xerrors (#483)
* remove xerrors

* move error variable

* update dependencies
2024-10-28 21:24:15 +09:00
Shuhei Kitagawa
8ad318cffc
Add lint job to CI (#477) 2024-10-28 11:31:15 +09:00
Yonas Habteab
3a90d7186f
Preserve defaults for zero initialised structs as well (#442) 2024-07-30 17:06:24 +09:00
Morris Kelly
b5f63d50d0
Fix decoding of scientific notation (#463)
* Fix scientific notation decoding and add encoding test cases

* Deal with ints and uints

* Add coverage for uint changes
2024-07-16 19:38:06 +09:00
Kirill
7ef5c6272b
support custom unmarshalling for map keys (#453)
Co-authored-by: k.safin@npo-echelon.ru <k.safin@npo-echelon.ru>
2024-06-19 17:51:44 +09:00
Kenta Mori
31fe1baace
fix: remove any trailing empty lines if the block scalar has strip indicator (#421) 2024-01-26 16:45:04 +09:00
ozraru
680ea24289
Fix handle of space at start or last (#376) 2023-09-14 12:36:25 +09:00
Ken’ichiro Oyama
6a080f2015
Handle \r in a double-quoted string the same as \n (#372)
* Add tests for string containing `\n` or `\r`

* Handle `\r` in a double-quoted string the same as `\n`

Fix https://github.com/goccy/go-yaml/issues/371
2023-05-24 17:12:33 +09:00
Masaaki Goshima
4052b059bc
Supports dynamically switch encode and decode processing for a given type (#368) 2023-04-02 10:50:03 +09:00
Masaaki Goshima
9044ecaef4
fix behavior when struct fields conflicted (#335) 2022-12-19 14:33:08 +09:00
Masaaki Goshima
6a9ddb5172
care whitespace 2022-12-02 17:03:39 +09:00
Masaaki Goshima
045101dc5f
add test cases 2022-12-02 03:56:31 +09:00
Masaaki Goshima
937c1674ec
Fix resusing process of scanning context 2022-11-14 19:19:25 +09:00
Florian Rey
941abdb723 Handle unmarshall unknown aliases 2022-09-16 13:16:00 +02:00
Masaaki Goshima
ecececdd25
Merge pull request #293 from jrisc/explicit_int64
Fix large literals type inference on 32 bits
2022-08-22 21:42:52 +09:00
Julien Rische
66e8faa858 Fix large literals type inference on 32 bits
Some tests are failing because some large literal integers are meant to
be stored on 64 bits, but are stored on 32 on 32 bits architectures.
This causes the value to overflow.

This commit fixes this issue by using explicit int64 typing.

Signed-off-by: Julien Rische <jrische@redhat.com>
2022-06-07 12:40:23 +02:00
Braydon Kains
dad2dedc90 yaml: typeError implements PrettyPrinter interface
When unmarshalling YAML and encountering an error in decoded that
results in a `yaml.typeError`, the error can't have the same nice
formatting because it doesn't implement the `errors.PrettyPrinter`
interface. This adds a field to the `yaml.typeError` struct that
specifies a token which is used in the implementation of the
PrettyPrinter interface. The tests were updated to instead match on
expected message substrings instead of full equality.
2022-02-09 23:06:32 +00:00
Alexander A. Klimov
df0b65c5de TestDecoder_DefaultValues(): also cover nested structs 2021-10-14 18:52:02 +02:00
Quentin Smith
f50bfefc06 Wrap conversion errors and add test 2021-08-18 01:13:25 -04:00
Quentin Smith
adc9a196b2 Encode and decode time.Duration fields (#201)
This uses `time.ParseDuration` and `time.Duration.String`, and is
compatible with gopkg.in/yaml's encoding.
2021-08-11 15:07:04 -04:00
Quentin Smith
367f635c83 Fix error reporting on inline structs in strict mode (#243) 2021-08-10 00:33:19 -04:00
zoncoen
416f941816
Fix decode nodes included anchors 2021-07-20 02:20:17 +09:00
Masaaki Goshima
894a764b31
Merge pull request #235 from goccy/feature/rename-context-api
Rename MarshalWithContext and UnmarshalWithContext
2021-07-19 22:03:38 +09:00
zoncoen
f6a3c23bf9
Add yaml.NodeToValue(ast.Node, interface{}, ...DecodeOption) error 2021-07-19 21:32:26 +09:00
Masaaki Goshima
c14dac734e Rename MarshalWithContext and UnmarshalWithContext 2021-07-19 19:01:49 +09:00
Masaaki Goshima
d1f2ceeb3d Add roundtrip test 2021-03-02 12:24:12 +09:00
Masaaki Goshima
8a0eacffd6 Support to decode ast.Node directly 2021-03-01 13:47:31 +09:00
David May
c11765e28c test: add more tests 2021-01-18 16:10:49 -06:00
David May
918aca63ab fix: force document markers to be at beginning of line 2021-01-18 13:33:07 -06:00
Masaaki Goshima
79c54b86d9 Add test cases 2020-11-12 16:03:42 +09:00
Masaaki Goshima
c395c330c5 Add UseJSONMarshaler option for encoder and UseJSONUnmarshaler option for decoder 2020-10-26 19:00:49 +09:00
Masaaki Goshima
23d3128925 Support io.Reader interface on ast.Node 2020-07-15 22:16:27 +09:00
Masaaki Goshima
f00b223dfd Add test case for decoding of canonical yaml 2020-07-02 17:26:35 +09:00