/*
 * Copyright (c) 2016, Inversoft Inc., All Rights Reserved
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the License.
 */

package com.inversoft.chef.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * Chef Node
 *
 * @author Daniel DeGroff
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class Node {
  public Map<String, Object> attributes = new LinkedHashMap<>();

  @JsonProperty("chef_environment")
  public String chefEnvironment;

  @JsonProperty("chef_type")
  public ChefType chefType;

  public Map<String, Object> defaults = new LinkedHashMap<>();

  @JsonProperty("json_class")
  public String jsonClass = "Chef::Node";

  public String name;

  public Map<String, Object> normal = new LinkedHashMap<>();

  public Map<String, Object> overrides = new LinkedHashMap<>();

  @JsonProperty("policy_group")
  public String policyGroup;

  @JsonProperty("policy_name")
  public String policyName;

  @JsonProperty("run_list")
  public List<String> runList = new ArrayList<>();
}

@@ -17,16 +17,21 @@
 (c) 2016
+-2018
 , Invers
@@ -657,16 +657,123 @@
 omain;%0A%0A
+import com.fasterxml.jackson.annotation.JsonAnySetter;%0Aimport com.fasterxml.jackson.annotation.JsonIgnore;%0A
 import c
@@ -1135,17 +1135,16 @@
 t%3E a
-ttributes
+utomatic
  = n
@@ -1290,24 +1290,51 @@
  chefType;%0A%0A
+  @JsonProperty(%22default%22)%0A
   public Map
@@ -1543,16 +1543,213 @@
 p%3C%3E();%0A%0A
+  /**%0A   * Any other properties on the incoming JSON response from Chef not accounted for by name will end up here.%0A   */%0A  @JsonIgnore%0A  public Map%3CString, Object%3E other = new LinkedHashMap%3C%3E();%0A%0A
   public
@@ -1777,17 +1777,16 @@
 override
-s
  = new L
@@ -2004,11 +2004,153 @@
 ist%3C%3E();
+%0A%0A  @JsonAnySetter%0A  public void setOtherAttribute(String key, Object value) %7B%0A    if (value != null) %7B%0A      other.put(key, value);%0A    %7D%0A  %7D
 %0A%7D%0A

Fix Node to pick up automatic, normal, override, and default attributes. Add a fail save attribute collector in case something else comes in, it will be stored in other. Issue #2.