@@ -146,6 +146,7 @@ public void addComponent(Component component) {
146146
147147 @ JacksonXmlElementWrapper (localName = "services" )
148148 @ JacksonXmlProperty (localName = "service" )
149+ @ VersionFilter (Version .VERSION_12 )
149150 public List <Service > getServices () {
150151 return services ;
151152 }
@@ -163,6 +164,7 @@ public void addService(Service service) {
163164
164165 @ JacksonXmlElementWrapper (useWrapping = false )
165166 @ JsonDeserialize (using = DependencyDeserializer .class )
167+ @ VersionFilter (Version .VERSION_11 )
166168 public List <Dependency > getDependencies () {
167169 return dependencies ;
168170 }
@@ -198,6 +200,7 @@ public void setExternalReferences(List<ExternalReference> externalReferences) {
198200
199201 @ JacksonXmlElementWrapper (localName = "compositions" )
200202 @ JacksonXmlProperty (localName = "composition" )
203+ @ VersionFilter (Version .VERSION_13 )
201204 public List <Composition > getCompositions () {
202205 return compositions ;
203206 }
@@ -208,6 +211,7 @@ public void setCompositions(List<Composition> compositions) {
208211
209212 @ JacksonXmlElementWrapper (localName = "formulation" )
210213 @ JacksonXmlProperty (localName = "formula" )
214+ @ VersionFilter (Version .VERSION_15 )
211215 public List <Formula > getFormulation () {
212216 return formulation ;
213217 }
@@ -218,12 +222,14 @@ public void setFormulation(final List<Formula> formulation) {
218222
219223 @ JacksonXmlElementWrapper (localName = "vulnerabilities" )
220224 @ JacksonXmlProperty (localName = "vulnerability" )
225+ @ VersionFilter (Version .VERSION_14 )
221226 public List <Vulnerability > getVulnerabilities () { return vulnerabilities ; }
222227
223228 public void setVulnerabilities (List <Vulnerability > vulnerabilities ) { this .vulnerabilities = vulnerabilities ; }
224229
225230 @ JacksonXmlElementWrapper (localName = "annotations" )
226231 @ JacksonXmlProperty (localName = "annotation" )
232+ @ VersionFilter (Version .VERSION_15 )
227233 public List <Annotation > getAnnotations () {
228234 return annotations ;
229235 }
@@ -234,6 +240,7 @@ public void setAnnotations(List<Annotation> annotations) {
234240
235241 @ JacksonXmlElementWrapper (localName = "properties" )
236242 @ JacksonXmlProperty (localName = "property" )
243+ @ JsonInclude (JsonInclude .Include .NON_EMPTY )
237244 public List <Property > getProperties () {
238245 return properties ;
239246 }
0 commit comments