Shuhei Kitagawa
f4d13479ba
Normalize CR and CRLF in multi-line strings ( #754 )
2025-11-29 11:32:30 +09:00
Brian Goff
90e8525591
Add decode option that allows specific field prefixes ( #795 )
...
This would be paired with DisallowUnknownField where you generally want
to make sure the yaml does not have unknown fields, but allow for cases
where the yaml has some extra stuff in it, e.g. for custom metadata or
using fields as variables for anchors.
In our specific case we allow `x-*` fields for these cases.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2025-10-21 10:27:08 +09:00
Patrick Gerber
52dacb84f3
Update custom marshaler and unmarshaler to accept context ( #745 )
...
* feat: Update custom marshaler and unmarshaler to accept context
* Add tests for custom marshaler and unmarshaler with context
2025-05-29 14:13:29 +09:00
Shuhei Kitagawa
680eea761f
Add support for multi-line double-quoted strings with CRLF line endings ( #744 )
2025-05-29 13:40:14 +09:00
Shuhei Kitagawa
6a6c998c2f
Prevent panic when decoding string named types ( #743 )
2025-05-26 09:14:35 +09:00
Masaaki Goshima
e61dcd0829
set null value for empty document ( #725 )
2025-05-08 00:40:41 +09:00
Shuhei Kitagawa
427b18e1b7
Avoid returning an error for null document ( #721 )
2025-05-07 21:29:47 +09:00
Masaaki Goshima
0203d69117
ignore validation for alias map key ( #720 )
2025-05-07 12:35:59 +09:00
Masaaki Goshima
ba0598a7f0
fix unmarshaler with comment ( #683 )
2025-03-31 20:25:09 +09:00
Denys Sedchenko
53701ccf36
feat: support receiving ast.Node in custom unmarshalers ( #642 )
...
* chore: ignore GoLand files
* feat: add NodeUnmarshaler and NodeUnmarshalerContext support
2025-03-16 19:31:01 +09:00
Masaaki Goshima
b46780d4c8
Keep reference of anchor's value ( #660 )
...
* keep reference of anchor's value
* add test case
2025-02-16 16:44:00 +09:00
Masaaki Goshima
2ac8cffa27
fix format with empty value ( #654 )
2025-02-12 15:22:20 +09:00
Masaaki Goshima
548e1b8de3
Fix format indent ( #653 )
...
* fix indent of formatted text
* add space to origin buffer for implicit null token
2025-02-12 14:29:07 +09:00
Masaaki Goshima
8f17441eeb
Fix format with alias ( #648 )
...
* fix format with alias
2025-02-11 22:02:56 +09:00
Masaaki Goshima
e6c495e058
fix format with comment ( #645 )
2025-02-09 15:09:26 +09:00
Masaaki Goshima
0653c80843
add node formatter ( #644 )
2025-02-09 14:42:50 +09:00
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