Shuhei Kitagawa
c8cc5c583f
Fix indentation for raw string newlines ( #625 )
...
https://github.com/goccy/go-yaml/issues/292
2025-01-31 10:27:06 +09:00
Masaaki Goshima
9cbf5d4217
Fix encoding of anchor and alias ( #605 )
...
* fix encoding of anchor and alias
* fix alias
* fix lint error
2024-12-23 10:25:20 +09:00
Masaaki Goshima
beec790be2
fix encoding with map key contains colon character ( #604 )
2024-12-22 20:28:28 +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
Shuhei Kitagawa
83d3e55c24
Fix quotation for timestamps ( #515 )
...
Co-authored-by: shuheiktgw <s-kitagawa@mercari.com>
2024-12-12 18:05:46 +09:00
Masaaki Goshima
6b0c68e62a
Fix parsing of document and string ( #513 )
...
* fix invalid test case
* fix parsing of document
* fix validation
2024-11-09 13:00:12 +09:00
Shuhei Kitagawa
8ad318cffc
Add lint job to CI ( #477 )
2024-10-28 11:31:15 +09:00
Ken’ichiro Oyama
237df0ef1c
Quote is required even if it begins with backquote. ( #440 )
2024-07-16 19:39:25 +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
ozraru
680ea24289
Fix handle of space at start or last ( #376 )
2023-09-14 12:36:25 +09:00
Kenta Mori
f5c5711fc6
fix: skip encoding an inline field if it is null ( #386 )
2023-09-13 17:17:47 +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
Martin Sucha
3ca6a75302
Don't trim all space characters in SequenceNode.blockStyleString ( #361 )
...
* Don't trim all space characters in SequenceNode.blockStyleString
This fixes https://github.com/goccy/go-yaml/issues/356 .
The code would have removed more spaces than it added.
A better solution long-term would probably be to add a specialized
method to StringNode to not add the prefix in the first place.
* Add issue 356 test case for block with first empty line
The indentation level in a block scalar is determined by the first
non-empty line.
2023-03-22 08:31:12 +09:00
Yusuke Kuoka
f3319d6c80
Quote YAML 1.1 bools at encoding time for compatibility with other legacy parsers ( #354 )
2023-03-14 15:24:34 +09:00
Masaaki Goshima
45bdea2a27
fix custom marshaler ( #333 )
2022-12-19 13:48:03 +09:00
Masaaki Goshima
bc437e1a54
Merge pull request #270 from igorpeshansky/fix-flow-mode-quotes
...
Quote strings with special characters in flow mode.
2022-10-26 17:43:50 +09:00
zoncoen
548aa0527d
fix: insert a separator between each encoded document
...
Fix the behavior as the comment.
2022-10-25 01:13:00 +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
Masaaki Goshima
d6e2aed126
Fix encoding of BytesMarshaler type
2022-01-11 18:15:12 +09:00
Masaaki Goshima
9bcbd0aebc
Fix encoding of sequence with multiline string
2022-01-11 17:43:12 +09:00
Igor Peshansky
450c46a149
Quote strings with special characters in flow mode.
2021-11-23 00:02:43 -05:00
Viktor Stanchev
e8c5eef27a
add UseSingleQuote option
2021-11-06 02:53:14 +00:00
Quentin Smith
02069998ec
Merge remote-tracking branch 'upstream/master' into duration
2021-08-24 16:44:27 -04:00
Quentin Smith
ad99694948
Fix encoding of large floats
...
An extra ".0" was getting appended when the value of the float was a
power of 10.
2021-08-16 16:31:14 -04:00
Quentin Smith
70a646fc95
Add test for Duration encoding in JSON mode
2021-08-12 14:56:40 -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
Viktor Stanchev
d51bcc85fc
fix bug in encoding nested sequences with IndentSequence
2021-08-09 14:06:30 +00:00
Masaaki Goshima
c14dac734e
Rename MarshalWithContext and UnmarshalWithContext
2021-07-19 19:01:49 +09:00
Ryo Kitagawa
036fc04cd4
Merge branch 'master' into support-defined-type-key
2021-06-30 14:34:11 +09:00
Florian Rey
4768d503b1
Support sequence indentation
2021-06-29 16:35:54 +02:00
Ryo Kitagawa
f3614c79b6
Support to encode map which has defined type key
2021-06-26 20:38:11 +09:00
Masaaki Goshima
0031d860a6
Fix encoding of float value
2021-03-01 16:17:23 +09:00
Masaaki Goshima
0eb1e3de9f
Support to encode ast.Node directly
2021-03-01 13:45:44 +09:00
Masaaki Goshima
eb2d4ab35f
Fix test case
2020-11-19 17:59:14 +09:00
Masaaki Goshima
7ea1684d4c
Merge pull request #164 from cmaster11/multiline-block-fix
...
Add `UseLiteralStyleIfMultiLine` option
2020-11-19 17:55:17 +09:00
Alberto Marchetti
6a3fb60539
* Addressed PR comments
2020-11-19 10:15:56 +02:00
Alberto Marchetti
b2c149ae52
Merge remote-tracking branch 'origin/multiline-block-fix' into multiline-block-fix
...
# Conflicts:
# encode.go
2020-11-18 07:36:24 +02:00
Alberto Marchetti
47f32d7bb0
* Addressed PR comments
...
* Added support for encode options in encoder test
2020-11-18 07:35:17 +02:00
Masaaki Goshima
754055144c
Fix flow style for composite type
2020-11-13 11:54:59 +09:00
Masaaki Goshima
e6e2ae45c0
Support encoding for array type
2020-11-12 19:17:56 +09:00
Masaaki Goshima
79c54b86d9
Add test cases
2020-11-12 16:03:42 +09:00
Alberto Marchetti
19ecaa472c
Merge branch 'master' into multiline-block-fix
2020-11-03 07:05:16 +02:00
Masaaki Goshima
c395c330c5
Add UseJSONMarshaler option for encoder and UseJSONUnmarshaler option for decoder
2020-10-26 19:00:49 +09:00
Alberto Marchetti
d82b4091f5
* force block as option
...
* more tests
2020-10-05 06:18:09 +03:00
Alberto Marchetti
934a103fda
more tests
2020-10-05 06:00:48 +03:00
Alberto Marchetti
4cc3cc1213
One more test
2020-10-04 14:06:39 +03:00
Alberto Marchetti
367c34bd18
Allows multiline strings containing "special YAML characters" to be represented in prettified blocks, instead of being quoted forcefully.
2020-10-04 13:58:25 +03:00
Masaaki Goshima
bb698f096d
Supports encoding in JSON format
2020-06-02 19:56:02 +09:00
k1LoW
eee356645b
Fix empty style ( slice, map, struct )
2020-03-09 21:58:05 +09:00