-
Notifications
You must be signed in to change notification settings - Fork 495
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug fix for process jackson annotation JsonIgnore, for issue #716
- Loading branch information
Showing
4 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
core/src/test/java/com/alibaba/fastjson2/issues/Issue716.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.alibaba.fastjson2.issues; | ||
|
||
import com.alibaba.fastjson2.JSON; | ||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class Issue716 { | ||
@Test | ||
public void test() { | ||
Bean bean = new Bean(); | ||
bean.id = 123; | ||
String str = JSON.toJSONString(bean); | ||
assertEquals(str, "{\"id\":123}"); | ||
} | ||
|
||
public static class Bean { | ||
@JsonIgnore(value = false) | ||
public int id; | ||
} | ||
} |