Use different class name than JSON with Jackson deserialization
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I'm trying to deserialize a JSON file with Jackson and I want to use different names for objects. I know how to set the @JsonProperty annotation but this doesn't work for class names. An example:
public class _my_class {
@JsonProperty("my_variable")
private String myVariable;
}
I want the class to be named MyClass. I also tried to use @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "MyClass") but it doesn't work too. Is there a solution to this?
EDIT
This is my simplified JSON file:
{
"CVE_data_type": "CVE",
"CVE_data_format": "MITRE",
"CVE_data_version": "4.0",
"CVE_data_numberOfCVEs": "1",
"CVE_data_timestamp": "2018-10-26T07:00Z",
"CVE_Items": [
{
"cve": {
"data_type": "CVE",
"data_format": "MITRE",
"data_version": "4.0",
"CVE_data_meta": {
"ID": "CVE-2018-0001",
"ASSIGNER": "my@mail.com"
},
"affects": {
"vendor": {
"vendor_data": [
{
"vendor_name": "myVendorName",
"product": {
"product_data": [
{
"product_name": "myProductName",
"version": {
"version_data": [
{
"version_value": "myVersionValue",
"version_affected": "myVersionAffected"
}
]
}
}
]
}
}
]
}
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "en",
"value": "myProblemtypeDescription"
}
]
}
]
},
"references": {
"reference_data": [
{
"url": "http://www.myReferenceDataUrl.com/",
"name": "myReferenceDataName",
"refsource": "myReferenceDataRefsource",
"tags": [
"myReferenceDataTagOne",
"myReferenceDataTagTwo"
]
}
]
},
"description": {
"description_data": [
{
"lang": "en",
"value": "myDescription"
}
]
}
},
"configurations": {
"CVE_data_version": "4.0",
"nodes": [
{
"operator": "OR",
"cpe": [
{
"vulnerable": true,
"cpe22Uri": "cpe:/o:this:is:a:cpe",
"cpe23Uri": "cpe:2.3:o:this:is:a:cpe:*:*:*:*:*:*",
"versionStartIncluding": "myVersionStartIncluding",
"versionStartExcluding": "myVersionStartExcluding",
"versionEndIncluding": "myVersionEndIncluding",
"versionEndExcluding": "myVersionEndExcluding"
},
{
"vulnerable": true,
"cpe22Uri": "cpe:/o:this:is:another:cpe",
"cpe23Uri": "cpe:2.3:o:this:is:another:cpe:*:*:*:*:*:*"
}
]
}
]
},
"impact": {
"baseMetricV3": {
"cvssV3": {
"version": "3.0",
"vectorString": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"attackVector": "NETWORK",
"attackComplexity": "LOW",
"privilegesRequired": "NONE",
"userInteraction": "NONE",
"scope": "UNCHANGED",
"confidentialityImpact": "HIGH",
"integrityImpact": "HIGH",
"availabilityImpact": "HIGH",
"baseScore": 9.8,
"baseSeverity": "CRITICAL"
},
"exploitabilityScore": 3.9,
"impactScore": 5.9
},
"baseMetricV2": {
"cvssV2": {
"version": "2.0",
"vectorString": "(AV:N/AC:L/Au:N/C:P/I:P/A:P)",
"accessVector": "NETWORK",
"accessComplexity": "LOW",
"authentication": "NONE",
"confidentialityImpact": "PARTIAL",
"integrityImpact": "PARTIAL",
"availabilityImpact": "PARTIAL",
"baseScore": 7.5
},
"severity": "HIGH",
"exploitabilityScore": 10.0,
"impactScore": 6.4,
"obtainAllPrivilege": false,
"obtainUserPrivilege": false,
"obtainOtherPrivilege": false,
"userInteractionRequired": false
}
},
"publishedDate": "2018-01-10T22:29Z",
"lastModifiedDate": "2018-02-23T02:29Z"
}
]
}
Now in want the corresponding class for the CVE Meta Data like this:
public class CVEDataMeta /* currently it's CVE_Data_Meta */ {
private String id;
private String assigner;
// getter and setters
}
EDIT 2
That's how i read the json file:
public CVE_Data deserialize(InputStream jsonStream) {
CVE_Data cveData = null;
ObjectMapper mapper = new ObjectMapper();
try {
cveData = mapper.readValue(jsonStream, CVE_Data.class);
} catch (...) {
...
}
return cveData;
}
java json jackson annotations
add a comment |
I'm trying to deserialize a JSON file with Jackson and I want to use different names for objects. I know how to set the @JsonProperty annotation but this doesn't work for class names. An example:
public class _my_class {
@JsonProperty("my_variable")
private String myVariable;
}
I want the class to be named MyClass. I also tried to use @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "MyClass") but it doesn't work too. Is there a solution to this?
EDIT
This is my simplified JSON file:
{
"CVE_data_type": "CVE",
"CVE_data_format": "MITRE",
"CVE_data_version": "4.0",
"CVE_data_numberOfCVEs": "1",
"CVE_data_timestamp": "2018-10-26T07:00Z",
"CVE_Items": [
{
"cve": {
"data_type": "CVE",
"data_format": "MITRE",
"data_version": "4.0",
"CVE_data_meta": {
"ID": "CVE-2018-0001",
"ASSIGNER": "my@mail.com"
},
"affects": {
"vendor": {
"vendor_data": [
{
"vendor_name": "myVendorName",
"product": {
"product_data": [
{
"product_name": "myProductName",
"version": {
"version_data": [
{
"version_value": "myVersionValue",
"version_affected": "myVersionAffected"
}
]
}
}
]
}
}
]
}
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "en",
"value": "myProblemtypeDescription"
}
]
}
]
},
"references": {
"reference_data": [
{
"url": "http://www.myReferenceDataUrl.com/",
"name": "myReferenceDataName",
"refsource": "myReferenceDataRefsource",
"tags": [
"myReferenceDataTagOne",
"myReferenceDataTagTwo"
]
}
]
},
"description": {
"description_data": [
{
"lang": "en",
"value": "myDescription"
}
]
}
},
"configurations": {
"CVE_data_version": "4.0",
"nodes": [
{
"operator": "OR",
"cpe": [
{
"vulnerable": true,
"cpe22Uri": "cpe:/o:this:is:a:cpe",
"cpe23Uri": "cpe:2.3:o:this:is:a:cpe:*:*:*:*:*:*",
"versionStartIncluding": "myVersionStartIncluding",
"versionStartExcluding": "myVersionStartExcluding",
"versionEndIncluding": "myVersionEndIncluding",
"versionEndExcluding": "myVersionEndExcluding"
},
{
"vulnerable": true,
"cpe22Uri": "cpe:/o:this:is:another:cpe",
"cpe23Uri": "cpe:2.3:o:this:is:another:cpe:*:*:*:*:*:*"
}
]
}
]
},
"impact": {
"baseMetricV3": {
"cvssV3": {
"version": "3.0",
"vectorString": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"attackVector": "NETWORK",
"attackComplexity": "LOW",
"privilegesRequired": "NONE",
"userInteraction": "NONE",
"scope": "UNCHANGED",
"confidentialityImpact": "HIGH",
"integrityImpact": "HIGH",
"availabilityImpact": "HIGH",
"baseScore": 9.8,
"baseSeverity": "CRITICAL"
},
"exploitabilityScore": 3.9,
"impactScore": 5.9
},
"baseMetricV2": {
"cvssV2": {
"version": "2.0",
"vectorString": "(AV:N/AC:L/Au:N/C:P/I:P/A:P)",
"accessVector": "NETWORK",
"accessComplexity": "LOW",
"authentication": "NONE",
"confidentialityImpact": "PARTIAL",
"integrityImpact": "PARTIAL",
"availabilityImpact": "PARTIAL",
"baseScore": 7.5
},
"severity": "HIGH",
"exploitabilityScore": 10.0,
"impactScore": 6.4,
"obtainAllPrivilege": false,
"obtainUserPrivilege": false,
"obtainOtherPrivilege": false,
"userInteractionRequired": false
}
},
"publishedDate": "2018-01-10T22:29Z",
"lastModifiedDate": "2018-02-23T02:29Z"
}
]
}
Now in want the corresponding class for the CVE Meta Data like this:
public class CVEDataMeta /* currently it's CVE_Data_Meta */ {
private String id;
private String assigner;
// getter and setters
}
EDIT 2
That's how i read the json file:
public CVE_Data deserialize(InputStream jsonStream) {
CVE_Data cveData = null;
ObjectMapper mapper = new ObjectMapper();
try {
cveData = mapper.readValue(jsonStream, CVE_Data.class);
} catch (...) {
...
}
return cveData;
}
java json jackson annotations
You can use JsonTypeInfo
– Sukhpal Singh
Nov 16 '18 at 12:31
I tried to but it did not work. Can you specify how exactly it have to be used?
– Konstantin P.
Nov 16 '18 at 16:07
show a sample json input file and the code how you read it in with Jackson. Please read How to create a Minimal, Complete, and Verifiable example.
– P.J.Meisch
Nov 16 '18 at 20:43
Class names don't matter. Property names matter. What matters is the name of the property inside the class that contains the CVEDataMeta object as a property.
– JB Nizet
Nov 17 '18 at 17:16
@JBNizet thanks! I thought the classes need to have the same name as the property in the json file.
– Konstantin P.
Nov 18 '18 at 16:36
add a comment |
I'm trying to deserialize a JSON file with Jackson and I want to use different names for objects. I know how to set the @JsonProperty annotation but this doesn't work for class names. An example:
public class _my_class {
@JsonProperty("my_variable")
private String myVariable;
}
I want the class to be named MyClass. I also tried to use @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "MyClass") but it doesn't work too. Is there a solution to this?
EDIT
This is my simplified JSON file:
{
"CVE_data_type": "CVE",
"CVE_data_format": "MITRE",
"CVE_data_version": "4.0",
"CVE_data_numberOfCVEs": "1",
"CVE_data_timestamp": "2018-10-26T07:00Z",
"CVE_Items": [
{
"cve": {
"data_type": "CVE",
"data_format": "MITRE",
"data_version": "4.0",
"CVE_data_meta": {
"ID": "CVE-2018-0001",
"ASSIGNER": "my@mail.com"
},
"affects": {
"vendor": {
"vendor_data": [
{
"vendor_name": "myVendorName",
"product": {
"product_data": [
{
"product_name": "myProductName",
"version": {
"version_data": [
{
"version_value": "myVersionValue",
"version_affected": "myVersionAffected"
}
]
}
}
]
}
}
]
}
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "en",
"value": "myProblemtypeDescription"
}
]
}
]
},
"references": {
"reference_data": [
{
"url": "http://www.myReferenceDataUrl.com/",
"name": "myReferenceDataName",
"refsource": "myReferenceDataRefsource",
"tags": [
"myReferenceDataTagOne",
"myReferenceDataTagTwo"
]
}
]
},
"description": {
"description_data": [
{
"lang": "en",
"value": "myDescription"
}
]
}
},
"configurations": {
"CVE_data_version": "4.0",
"nodes": [
{
"operator": "OR",
"cpe": [
{
"vulnerable": true,
"cpe22Uri": "cpe:/o:this:is:a:cpe",
"cpe23Uri": "cpe:2.3:o:this:is:a:cpe:*:*:*:*:*:*",
"versionStartIncluding": "myVersionStartIncluding",
"versionStartExcluding": "myVersionStartExcluding",
"versionEndIncluding": "myVersionEndIncluding",
"versionEndExcluding": "myVersionEndExcluding"
},
{
"vulnerable": true,
"cpe22Uri": "cpe:/o:this:is:another:cpe",
"cpe23Uri": "cpe:2.3:o:this:is:another:cpe:*:*:*:*:*:*"
}
]
}
]
},
"impact": {
"baseMetricV3": {
"cvssV3": {
"version": "3.0",
"vectorString": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"attackVector": "NETWORK",
"attackComplexity": "LOW",
"privilegesRequired": "NONE",
"userInteraction": "NONE",
"scope": "UNCHANGED",
"confidentialityImpact": "HIGH",
"integrityImpact": "HIGH",
"availabilityImpact": "HIGH",
"baseScore": 9.8,
"baseSeverity": "CRITICAL"
},
"exploitabilityScore": 3.9,
"impactScore": 5.9
},
"baseMetricV2": {
"cvssV2": {
"version": "2.0",
"vectorString": "(AV:N/AC:L/Au:N/C:P/I:P/A:P)",
"accessVector": "NETWORK",
"accessComplexity": "LOW",
"authentication": "NONE",
"confidentialityImpact": "PARTIAL",
"integrityImpact": "PARTIAL",
"availabilityImpact": "PARTIAL",
"baseScore": 7.5
},
"severity": "HIGH",
"exploitabilityScore": 10.0,
"impactScore": 6.4,
"obtainAllPrivilege": false,
"obtainUserPrivilege": false,
"obtainOtherPrivilege": false,
"userInteractionRequired": false
}
},
"publishedDate": "2018-01-10T22:29Z",
"lastModifiedDate": "2018-02-23T02:29Z"
}
]
}
Now in want the corresponding class for the CVE Meta Data like this:
public class CVEDataMeta /* currently it's CVE_Data_Meta */ {
private String id;
private String assigner;
// getter and setters
}
EDIT 2
That's how i read the json file:
public CVE_Data deserialize(InputStream jsonStream) {
CVE_Data cveData = null;
ObjectMapper mapper = new ObjectMapper();
try {
cveData = mapper.readValue(jsonStream, CVE_Data.class);
} catch (...) {
...
}
return cveData;
}
java json jackson annotations
I'm trying to deserialize a JSON file with Jackson and I want to use different names for objects. I know how to set the @JsonProperty annotation but this doesn't work for class names. An example:
public class _my_class {
@JsonProperty("my_variable")
private String myVariable;
}
I want the class to be named MyClass. I also tried to use @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "MyClass") but it doesn't work too. Is there a solution to this?
EDIT
This is my simplified JSON file:
{
"CVE_data_type": "CVE",
"CVE_data_format": "MITRE",
"CVE_data_version": "4.0",
"CVE_data_numberOfCVEs": "1",
"CVE_data_timestamp": "2018-10-26T07:00Z",
"CVE_Items": [
{
"cve": {
"data_type": "CVE",
"data_format": "MITRE",
"data_version": "4.0",
"CVE_data_meta": {
"ID": "CVE-2018-0001",
"ASSIGNER": "my@mail.com"
},
"affects": {
"vendor": {
"vendor_data": [
{
"vendor_name": "myVendorName",
"product": {
"product_data": [
{
"product_name": "myProductName",
"version": {
"version_data": [
{
"version_value": "myVersionValue",
"version_affected": "myVersionAffected"
}
]
}
}
]
}
}
]
}
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "en",
"value": "myProblemtypeDescription"
}
]
}
]
},
"references": {
"reference_data": [
{
"url": "http://www.myReferenceDataUrl.com/",
"name": "myReferenceDataName",
"refsource": "myReferenceDataRefsource",
"tags": [
"myReferenceDataTagOne",
"myReferenceDataTagTwo"
]
}
]
},
"description": {
"description_data": [
{
"lang": "en",
"value": "myDescription"
}
]
}
},
"configurations": {
"CVE_data_version": "4.0",
"nodes": [
{
"operator": "OR",
"cpe": [
{
"vulnerable": true,
"cpe22Uri": "cpe:/o:this:is:a:cpe",
"cpe23Uri": "cpe:2.3:o:this:is:a:cpe:*:*:*:*:*:*",
"versionStartIncluding": "myVersionStartIncluding",
"versionStartExcluding": "myVersionStartExcluding",
"versionEndIncluding": "myVersionEndIncluding",
"versionEndExcluding": "myVersionEndExcluding"
},
{
"vulnerable": true,
"cpe22Uri": "cpe:/o:this:is:another:cpe",
"cpe23Uri": "cpe:2.3:o:this:is:another:cpe:*:*:*:*:*:*"
}
]
}
]
},
"impact": {
"baseMetricV3": {
"cvssV3": {
"version": "3.0",
"vectorString": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"attackVector": "NETWORK",
"attackComplexity": "LOW",
"privilegesRequired": "NONE",
"userInteraction": "NONE",
"scope": "UNCHANGED",
"confidentialityImpact": "HIGH",
"integrityImpact": "HIGH",
"availabilityImpact": "HIGH",
"baseScore": 9.8,
"baseSeverity": "CRITICAL"
},
"exploitabilityScore": 3.9,
"impactScore": 5.9
},
"baseMetricV2": {
"cvssV2": {
"version": "2.0",
"vectorString": "(AV:N/AC:L/Au:N/C:P/I:P/A:P)",
"accessVector": "NETWORK",
"accessComplexity": "LOW",
"authentication": "NONE",
"confidentialityImpact": "PARTIAL",
"integrityImpact": "PARTIAL",
"availabilityImpact": "PARTIAL",
"baseScore": 7.5
},
"severity": "HIGH",
"exploitabilityScore": 10.0,
"impactScore": 6.4,
"obtainAllPrivilege": false,
"obtainUserPrivilege": false,
"obtainOtherPrivilege": false,
"userInteractionRequired": false
}
},
"publishedDate": "2018-01-10T22:29Z",
"lastModifiedDate": "2018-02-23T02:29Z"
}
]
}
Now in want the corresponding class for the CVE Meta Data like this:
public class CVEDataMeta /* currently it's CVE_Data_Meta */ {
private String id;
private String assigner;
// getter and setters
}
EDIT 2
That's how i read the json file:
public CVE_Data deserialize(InputStream jsonStream) {
CVE_Data cveData = null;
ObjectMapper mapper = new ObjectMapper();
try {
cveData = mapper.readValue(jsonStream, CVE_Data.class);
} catch (...) {
...
}
return cveData;
}
java json jackson annotations
java json jackson annotations
edited Nov 17 '18 at 17:11
Konstantin P.
asked Nov 16 '18 at 12:27
Konstantin P.Konstantin P.
63
63
You can use JsonTypeInfo
– Sukhpal Singh
Nov 16 '18 at 12:31
I tried to but it did not work. Can you specify how exactly it have to be used?
– Konstantin P.
Nov 16 '18 at 16:07
show a sample json input file and the code how you read it in with Jackson. Please read How to create a Minimal, Complete, and Verifiable example.
– P.J.Meisch
Nov 16 '18 at 20:43
Class names don't matter. Property names matter. What matters is the name of the property inside the class that contains the CVEDataMeta object as a property.
– JB Nizet
Nov 17 '18 at 17:16
@JBNizet thanks! I thought the classes need to have the same name as the property in the json file.
– Konstantin P.
Nov 18 '18 at 16:36
add a comment |
You can use JsonTypeInfo
– Sukhpal Singh
Nov 16 '18 at 12:31
I tried to but it did not work. Can you specify how exactly it have to be used?
– Konstantin P.
Nov 16 '18 at 16:07
show a sample json input file and the code how you read it in with Jackson. Please read How to create a Minimal, Complete, and Verifiable example.
– P.J.Meisch
Nov 16 '18 at 20:43
Class names don't matter. Property names matter. What matters is the name of the property inside the class that contains the CVEDataMeta object as a property.
– JB Nizet
Nov 17 '18 at 17:16
@JBNizet thanks! I thought the classes need to have the same name as the property in the json file.
– Konstantin P.
Nov 18 '18 at 16:36
You can use JsonTypeInfo
– Sukhpal Singh
Nov 16 '18 at 12:31
You can use JsonTypeInfo
– Sukhpal Singh
Nov 16 '18 at 12:31
I tried to but it did not work. Can you specify how exactly it have to be used?
– Konstantin P.
Nov 16 '18 at 16:07
I tried to but it did not work. Can you specify how exactly it have to be used?
– Konstantin P.
Nov 16 '18 at 16:07
show a sample json input file and the code how you read it in with Jackson. Please read How to create a Minimal, Complete, and Verifiable example.
– P.J.Meisch
Nov 16 '18 at 20:43
show a sample json input file and the code how you read it in with Jackson. Please read How to create a Minimal, Complete, and Verifiable example.
– P.J.Meisch
Nov 16 '18 at 20:43
Class names don't matter. Property names matter. What matters is the name of the property inside the class that contains the CVEDataMeta object as a property.
– JB Nizet
Nov 17 '18 at 17:16
Class names don't matter. Property names matter. What matters is the name of the property inside the class that contains the CVEDataMeta object as a property.
– JB Nizet
Nov 17 '18 at 17:16
@JBNizet thanks! I thought the classes need to have the same name as the property in the json file.
– Konstantin P.
Nov 18 '18 at 16:36
@JBNizet thanks! I thought the classes need to have the same name as the property in the json file.
– Konstantin P.
Nov 18 '18 at 16:36
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53337919%2fuse-different-class-name-than-json-with-jackson-deserialization%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53337919%2fuse-different-class-name-than-json-with-jackson-deserialization%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You can use JsonTypeInfo
– Sukhpal Singh
Nov 16 '18 at 12:31
I tried to but it did not work. Can you specify how exactly it have to be used?
– Konstantin P.
Nov 16 '18 at 16:07
show a sample json input file and the code how you read it in with Jackson. Please read How to create a Minimal, Complete, and Verifiable example.
– P.J.Meisch
Nov 16 '18 at 20:43
Class names don't matter. Property names matter. What matters is the name of the property inside the class that contains the CVEDataMeta object as a property.
– JB Nizet
Nov 17 '18 at 17:16
@JBNizet thanks! I thought the classes need to have the same name as the property in the json file.
– Konstantin P.
Nov 18 '18 at 16:36