package io.reactivesw.products.models.attributes;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * Created by umasuo on 16/11/17.
 */
@ApiModel
public class Attribute {

  @ApiModelProperty(value = "Attribute Name", required = true)
  private String name;

  @ApiModelProperty(value = "A valid JSON value, based on an AttributeDefinition.",required = true)
  @JsonSerialize
  private JsonNode value;


  @JsonCreator
  public Attribute(final String name, final JsonNode value) {
    this.name = name;
    this.value = value;
  }

  public String getName() {
    return name;
  }

  public JsonNode getValue() {
    return value;
  }
}

@@ -547,16 +547,17 @@
 ition.%22,
+ 
 required
@@ -569,25 +569,8 @@
 ue)%0A
-  @JsonSerialize%0A
   pr
@@ -596,24 +596,8 @@
 e;%0A%0A
-%0A  @JsonCreator%0A
   pu
@@ -615,32 +615,75 @@
 ute(
-final String name, final
+) %7B%0A  %7D%0A%0A  public String getName() %7B%0A    return name;%0A  %7D%0A%0A  public
  Jso
@@ -692,21 +692,25 @@
 ode 
-v
+getV
 alue
+(
 ) %7B%0A    
 this
@@ -709,42 +709,14 @@
     
-this.name = name;%0A    this.value =
+return
  val
@@ -733,39 +733,48 @@
  public 
+void setName(
 String 
-getN
+n
 ame
-(
 ) %7B%0A    
 return n
@@ -757,38 +757,43 @@
 ing name) %7B%0A    
-return
+this.name =
  name;%0A  %7D%0A%0A  pu
@@ -789,32 +789,46 @@
 ;%0A  %7D%0A%0A  public 
+void setValue(
 JsonNode getValu
@@ -820,33 +820,29 @@
 sonNode 
-getV
+v
 alue
-(
 ) %7B%0A    
 return v
@@ -825,36 +825,42 @@
 de value) %7B%0A    
-return
+this.value =
  value;%0A  %7D%0A%7D%0A

fix attribute