From ad4ec4bcdeffd2d7236a839df38e21cb65c0fe29 Mon Sep 17 00:00:00 2001
From: Javier Velilla <javier.hector@gmail.com>
Date: Mon, 3 Aug 2015 15:32:33 -0300
Subject: [PATCH 01/47] Update README

---
 README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README b/README
index 38c5335..f39397d 100644
--- a/README
+++ b/README
@@ -4,5 +4,5 @@ HAL is used for exposing RESTful hypermedia APIs. Right now the current implemen
 JSON_HAL
 
 References
-http://tools.ietf.org/html/draft-kelly-json-hal-06
+http://tools.ietf.org/html/draft-kelly-json-hal-07
 http://stateless.co/hal_specification.html#json

From 238e128f01137f3b99ad31991bb05203ee457f1c Mon Sep 17 00:00:00 2001
From: Jocelyn Fiat <github@djoce.net>
Date: Thu, 22 Jun 2017 11:25:56 +0200
Subject: [PATCH 02/47] Changed type of a few string feature, to support
 unicode name and values in HAL document. Removed usage of obsolete JSON
 converters. Removed warnings in HAL library.

---
 .../hal_resource_json_deserializer.e          | 220 +++++++++++
 .../converter/hal_resource_json_serializer.e  | 216 +++++++++++
 .../converter/json_hal_resource_converter.e   | 353 +-----------------
 library/hal.rc                                |   6 -
 library/hal_access.e                          |   9 +
 library/hal_link_attribute.e                  |   9 +-
 library/hal_resource.e                        |  97 +++--
 package.iron                                  |  21 ++
 test/application.e                            | 146 ++++----
 test/converter/json_customer_converter.e      | 107 +++---
 test/converter/json_item_converter.e          |  73 ++--
 test/converter/json_line_item_converter.e     | 166 ++++----
 test/converter/json_order_converter.e         | 229 ++++++------
 test/hal_test_suite.e                         |  86 ++---
 test/model/customer.e                         |  14 +-
 test/model/item.e                             |  22 +-
 test/model/line_item.e                        |  46 +--
 test/model/order.e                            |   4 +-
 test/model/order_repository.e                 |  42 ++-
 test/model/shared_order_repository.e          |   4 +-
 test/test.rc                                  |   6 -
 21 files changed, 988 insertions(+), 888 deletions(-)
 create mode 100644 library/converter/hal_resource_json_deserializer.e
 create mode 100644 library/converter/hal_resource_json_serializer.e
 delete mode 100644 library/hal.rc
 create mode 100644 library/hal_access.e
 create mode 100644 package.iron
 delete mode 100644 test/test.rc

diff --git a/library/converter/hal_resource_json_deserializer.e b/library/converter/hal_resource_json_deserializer.e
new file mode 100644
index 0000000..4d4a07a
--- /dev/null
+++ b/library/converter/hal_resource_json_deserializer.e
@@ -0,0 +1,220 @@
+note
+	description: "Summary description for {HAL_RESOURCE_JSON_DESERIALIZER}."
+	date: "$Date$"
+	revision: "$Revision$"
+
+class
+	HAL_RESOURCE_JSON_DESERIALIZER
+
+inherit
+	JSON_DESERIALIZER
+
+	HAL_ACCESS
+
+feature -- Conversion
+
+	from_json (a_json: detachable JSON_VALUE; ctx: JSON_DESERIALIZER_CONTEXT; a_type: detachable TYPE [detachable ANY]): detachable HAL_RESOURCE
+			-- Eiffel value deserialized from `a_json' value, in the eventual context `ctx'.
+		local
+			l_list: LIST [HAL_RESOURCE]
+			js: JSON_STRING
+		do
+			if attached {JSON_OBJECT} a_json as j then
+				create Result.make
+				across
+					j.current_keys as ic
+				loop
+					js := ic.item
+					if
+						not (js.is_equal (links_key) or js.is_equal (embedded_key)) and then
+						attached j.item (js) as j_rep
+					then
+						if attached {JSON_STRING} j_rep as js_rep then
+							Result.add_field (js.item, js_rep.unescaped_string_32)
+						elseif attached {JSON_NUMBER} j_rep as jn_rep then
+							Result.add_field (js.item, jn_rep.item)
+						elseif attached {JSON_BOOLEAN} j_rep as jb_rep then
+							Result.add_field (js.item, jb_rep.item.out)
+						elseif attached {JSON_NULL} j_rep as jnull then
+							Result.add_field (js.item, "null")
+						else
+							Result.add_field (js.item, j_rep.representation)
+						end
+					end
+				end
+
+				if attached {JSON_OBJECT} j.item (links_key) as l_links then
+					Result.add_all_links (from_json_link (l_links, ctx))
+				end
+
+				if attached {JSON_OBJECT} j.item (embedded_key) as l_embedded then
+					across
+						l_embedded.current_keys as ic
+					loop
+						js := ic.item
+						if attached {JSON_OBJECT} l_embedded.item (js) as jo then
+							create {ARRAYED_LIST [HAL_RESOURCE]} l_list.make (1)
+							if attached from_json (jo, ctx, Void) as jo_r then
+								l_list.force (jo_r)
+								Result.add_embedded_resources_with_key (js.item, l_list)
+							end
+						elseif attached {JSON_ARRAY} l_embedded.item (js) as jea then
+							create {ARRAYED_LIST [HAL_RESOURCE]} l_list.make (jea.count)
+							across
+								jea as jea_ic
+							loop
+								if
+									attached {JSON_OBJECT} jea_ic.item as jeai and then
+									attached from_json (jeai, ctx, Void) as jeai_r
+								then
+									l_list.force (jeai_r)
+								end
+							end
+							Result.add_embedded_resources_with_key (js.item, l_list)
+						end
+					end
+				end
+			end
+		end
+
+feature {NONE} -- Converter implementation
+
+	from_json_link (j: JSON_OBJECT; ctx: detachable JSON_DESERIALIZER_CONTEXT): STRING_TABLE [HAL_LINK]
+		local
+			l_keys: ARRAY [JSON_STRING]
+			js: JSON_STRING
+			i, k: INTEGER
+			l_link: HAL_LINK
+		do
+			create Result.make (2)
+			from
+				i := 1
+				l_keys := j.current_keys
+			until
+				i > l_keys.count
+			loop
+				js := l_keys [i]
+				if
+					attached {JSON_OBJECT} j.item (js) as jo and then
+					attached new_link_attributes (jo, ctx) as la
+				then
+					create l_link.make_with_attribute (js.item, la)
+					Result.force (l_link, js.item)
+				elseif attached {JSON_ARRAY} j.item (js) as ja then
+					create l_link.make (l_keys [i].item)
+					from
+						k := 1
+					until
+						k > ja.count
+					loop
+						if
+							attached {JSON_OBJECT} ja.i_th (k) as ji and then
+							attached new_link_attributes (ji, ctx) as lai
+						then
+							l_link.add_attribute (lai)
+						end
+						k := k + 1
+					end
+					Result.force (l_link, js.item)
+				end
+				i := i + 1
+			end
+		end
+
+	new_link_attributes (j: JSON_OBJECT; ctx: detachable JSON_DESERIALIZER_CONTEXT): detachable HAL_LINK_ATTRIBUTE
+			-- create an object LINK_ATTRIBUTE from a JSON_OBJECT
+		do
+				--|TODO refactor to make it simpler
+			if attached {JSON_STRING} j.item (href_key) as j_href then
+				create Result.make (j_href.item)
+				if attached {JSON_STRING} j.item (name_key) as j_name then
+					Result.set_name (j_name.item)
+				end
+				if attached {JSON_STRING} j.item (title_key) as j_title then
+					Result.set_title (j_title.item)
+				end
+				if attached {JSON_STRING} j.item (hreflang_key) as j_hreflang then
+					Result.set_hreflang (j_hreflang.item)
+				end
+				if attached {JSON_BOOLEAN} j.item (templated_key) as j_templated then
+					Result.set_templated (j_templated.item)
+				end
+				if attached {JSON_STRING} j.item (type_key) as j_type then
+					Result.set_type (j_type.item)
+				end
+				if attached {JSON_STRING} j.item (deprecation_key) as j_deprecation then
+					Result.set_deprecation (j_deprecation.item)
+				end
+				if attached {JSON_STRING} j.item (profile_key) as j_profile then
+					Result.set_profile (j_profile.item)
+				end
+			end
+		end
+
+feature {NONE} -- Implementation: RESOURCE
+
+	links_key: JSON_STRING
+		once
+			create Result.make_from_string ("_links")
+		end
+
+	embedded_key: JSON_STRING
+		once
+			create Result.make_from_string ("_embedded")
+		end
+
+feature {NONE} -- Implementation: LINK
+
+	href_key: JSON_STRING
+		once
+			create Result.make_from_string ("href")
+		end
+
+	ref_key: JSON_STRING
+		once
+			create Result.make_from_String ("ref")
+		end
+
+feature {NONE} -- Implementation: LINK_ATTRIBUTE
+
+	name_key: JSON_STRING
+		once
+			create Result.make_from_string("name")
+		end
+
+	title_key: JSON_STRING
+		once
+			create Result.make_from_string ("title")
+		end
+
+	hreflang_key: JSON_STRING
+		once
+			create Result.make_from_string ("hreflang")
+		end
+
+	templated_key: JSON_STRING
+		once
+			create Result.make_from_string ("templated")
+		end
+
+	type_key: JSON_STRING
+		once
+			create Result.make_from_string ("type")
+		end
+
+	deprecation_key: JSON_STRING
+		once
+			create Result.make_from_string ("deprecation")
+		end
+
+	profile_key: JSON_STRING
+		once
+			create Result.make_from_string ("profile")
+		end
+
+	curies_key: JSON_STRING
+		once
+			create Result.make_from_string ("curies")
+		end
+
+end
diff --git a/library/converter/hal_resource_json_serializer.e b/library/converter/hal_resource_json_serializer.e
new file mode 100644
index 0000000..aad5366
--- /dev/null
+++ b/library/converter/hal_resource_json_serializer.e
@@ -0,0 +1,216 @@
+note
+	description: "Summary description for {HAL_RESOURCE_JSON_SERIALIZER}."
+	author: ""
+	date: "$Date$"
+	revision: "$Revision$"
+
+class
+	HAL_RESOURCE_JSON_SERIALIZER
+
+inherit
+	JSON_SERIALIZER
+
+	HAL_ACCESS
+
+feature -- Convertion
+
+	to_json (obj: detachable ANY; ctx: JSON_SERIALIZER_CONTEXT): JSON_VALUE
+			-- JSON value representing the JSON serialization of Eiffel value `obj', in the eventual context `ctx'.	
+		local
+			jo: JSON_OBJECT
+		do
+			if attached {HAL_RESOURCE} obj as o then
+				create jo.make
+				jo.put (to_json_links (o.links, ctx), links_key)
+				if attached o.embedded_resource as l_embedded_resource then
+					jo.put (to_json_embedded_resource (l_embedded_resource, ctx), embedded_key)
+				end
+				if attached o.fields as l_fields then
+					across
+						l_fields as ic
+					loop
+						jo.put_string (ic.item, ic.key)
+					end
+				end
+				Result := jo
+			else
+				create {JSON_NULL} Result
+			end
+		end
+
+feature {NONE} -- Converter implementation
+
+	to_json_embedded_resource (a_embedded_resource: TABLE_ITERABLE [LIST [HAL_RESOURCE], READABLE_STRING_GENERAL]; ctx: JSON_SERIALIZER_CONTEXT): JSON_OBJECT
+		do
+			create Result.make
+			across
+				a_embedded_resource as ic
+			loop
+				Result.put (to_json_embedded_resource_internal (ic.item, ctx), ic.key)
+			end
+		end
+
+	to_json_embedded_resource_internal (a_resource: LIST [HAL_RESOURCE]; ctx: JSON_SERIALIZER_CONTEXT): JSON_VALUE
+		local
+			l_result_arr: JSON_ARRAY
+		do
+			if a_resource.count = 1 then
+				Result := to_json (a_resource.first, ctx)
+			else
+				create {JSON_ARRAY} l_result_arr.make_empty
+				across
+					a_resource as ic
+				loop
+					if attached to_json (ic.item, ctx) as l_iter then
+						l_result_arr.add (l_iter)
+					end
+				end
+				Result := l_result_arr
+			end
+		end
+
+	to_json_links (a_links: TABLE_ITERABLE [HAL_LINK, READABLE_STRING_GENERAL]; ctx: JSON_SERIALIZER_CONTEXT): JSON_OBJECT
+		do
+			create Result.make
+			across
+				a_links as ic
+			loop
+				if ic.key.is_case_insensitive_equal (curies_key.item) then
+					Result.put (to_json_link_curies (ic.item, ctx), ic.key)
+				else
+					Result.put (to_json_link_internal (ic.item, ctx), ic.key)
+				end
+			end
+		end
+
+	to_json_link_internal (a_link: HAL_LINK; ctx: JSON_SERIALIZER_CONTEXT): JSON_VALUE
+		local
+			l_result_arr: JSON_ARRAY
+		do
+			if attached a_link.attributes as l_attribs then
+				if l_attribs.count = 1 then
+					Result := to_json_link_attribute (l_attribs.first, ctx)
+				else
+					create {JSON_ARRAY} l_result_arr.make_empty
+					across
+						l_attribs as ic
+					loop
+						l_result_arr.add (to_json_link_attribute (ic.item, ctx))
+					end
+					Result := l_result_arr
+				end
+			else
+				create {JSON_NULL} Result
+			end
+		end
+
+	to_json_link_curies (a_link: HAL_LINK; ctx: JSON_SERIALIZER_CONTEXT): JSON_VALUE
+		local
+			l_result_arr: JSON_ARRAY
+		do
+			create {JSON_ARRAY} l_result_arr.make_empty
+			if attached a_link.attributes as l_attribs then
+				across
+					l_attribs as ic
+				loop
+					l_result_arr.add (to_json_link_attribute (ic.item, ctx))
+				end
+			end
+			Result := l_result_arr
+		end
+
+	to_json_link_attribute (a_link_attribute: HAL_LINK_ATTRIBUTE; ctx: JSON_SERIALIZER_CONTEXT): JSON_OBJECT
+		do
+			create Result.make
+			if attached a_link_attribute.name as l_name then
+				Result.put_string (l_name, name_key)
+			end
+			Result.put_string (a_link_attribute.href, href_key)
+			if attached a_link_attribute.hreflang as l_hreflang then
+				Result.put_string (l_hreflang, hreflang_key)
+			end
+			if attached a_link_attribute.title as l_title then
+				Result.put_string (l_title, title_key)
+			end
+			if attached a_link_attribute.templated as l_templated then
+				Result.put_boolean (l_templated, templated_key)
+			end
+			if attached a_link_attribute.deprecation as l_deprecation then
+				Result.put_string (l_deprecation, deprecation_key)
+			end
+			if attached a_link_attribute.type as l_type then
+				Result.put_string (l_type, type_key)
+			end
+			if attached a_link_attribute.profile as l_profile then
+				Result.put_string (l_profile, profile_key)
+			end
+
+		end
+
+feature {NONE} -- Implementation: RESOURCE
+
+	links_key: JSON_STRING
+		once
+			create Result.make_from_string ("_links")
+		end
+
+	embedded_key: JSON_STRING
+		once
+			create Result.make_from_string ("_embedded")
+		end
+
+feature {NONE} -- Implementation: LINK
+
+	href_key: JSON_STRING
+		once
+			create Result.make_from_string ("href")
+		end
+
+	ref_key: JSON_STRING
+		once
+			create Result.make_from_String ("ref")
+		end
+
+feature {NONE} -- Implementation: LINK_ATTRIBUTE
+
+	name_key: JSON_STRING
+		once
+			create Result.make_from_string("name")
+		end
+
+	title_key: JSON_STRING
+		once
+			create Result.make_from_string ("title")
+		end
+
+	hreflang_key: JSON_STRING
+		once
+			create Result.make_from_string ("hreflang")
+		end
+
+	templated_key: JSON_STRING
+		once
+			create Result.make_from_string ("templated")
+		end
+
+	type_key: JSON_STRING
+		once
+			create Result.make_from_string ("type")
+		end
+
+	deprecation_key: JSON_STRING
+		once
+			create Result.make_from_string ("deprecation")
+		end
+
+	profile_key: JSON_STRING
+		once
+			create Result.make_from_string ("profile")
+		end
+
+	curies_key: JSON_STRING
+		once
+			create Result.make_from_string ("curies")
+		end
+
+end
diff --git a/library/converter/json_hal_resource_converter.e b/library/converter/json_hal_resource_converter.e
index 2766316..b31821f 100644
--- a/library/converter/json_hal_resource_converter.e
+++ b/library/converter/json_hal_resource_converter.e
@@ -10,8 +10,7 @@ class
 	JSON_HAL_RESOURCE_CONVERTER
 
 inherit
-
-	JSON_CONVERTER
+	HAL_ACCESS
 
 create
 	make
@@ -20,356 +19,30 @@ feature {NONE} -- Initialization
 
 	make
 		do
-			create object.make
 		end
 
 feature -- Access
 
-	object: HAL_RESOURCE
-
-	value: detachable JSON_OBJECT
-
-	from_json (j: attached like value): detachable like object
+	from_json (j: JSON_VALUE): detachable HAL_RESOURCE
 			-- Convert from JSON value. Returns Void if unable to convert
 		local
-			l_list: LIST [like object]
-			j_array, l_embedded_keys: ARRAY [JSON_STRING]
-			js: JSON_STRING
-			i, k, l: INTEGER
+			ser: HAL_RESOURCE_JSON_DESERIALIZER
+			ctx: JSON_DESERIALIZER_CONTEXT
 		do
-				--| TODO: Refactor to make it simpler
-			create Result.make
-			from
-				i := 1
-				j_array := j.current_keys
-			until
-				i > j_array.count
-			loop
-				js := j_array [i]
-				if
-					not (js.is_equal (links_key) or js.is_equal (embedded_key)) and then
-					attached j.item (js) as l_rep
-				then
-					Result.add_fields (js.item, l_rep.representation)
-				end
-				i := i + 1
-			end
-			if attached {JSON_OBJECT} j.item (links_key) as ll_links then
-				Result.add_all_links (from_json_link (ll_links))
-			end
-			if attached {JSON_OBJECT} j.item (embedded_key) as ll_embedded then
-				from
-					k := 1
-					l_embedded_keys := ll_embedded.current_keys
-				until
-					k > l_embedded_keys.count
-				loop
-					js := l_embedded_keys [k]
-					if attached {JSON_OBJECT} ll_embedded.item (js) as jo then
-						create {ARRAYED_LIST [like object]} l_list.make (1)
-						if attached from_json (jo) as jo_r then
-							l_list.force (jo_r)
-							Result.add_embedded_resources_with_key (js.item, l_list)
-						end
-					elseif attached {JSON_ARRAY} ll_embedded.item (js) as jea then
-						create {ARRAYED_LIST [like object]} l_list.make (jea.count)
-						from
-							l := 1
-						until
-							l > jea.count
-						loop
-							if
-								attached {JSON_OBJECT} jea.i_th (l) as jeai and then
-								attached from_json (jeai) as jeai_r
-							then
-								l_list.force (jeai_r)
-							end
-							l := l + 1
-						end
-						Result.add_embedded_resources_with_key (js.item, l_list)
-					end
-					k := k + 1
-				end
-			end
+			create ser
+			create ctx
+			Result := ser.from_json (j, ctx, Void)
 		end
 
-	to_json (o: like object): like value
+	to_json (o: HAL_RESOURCE): JSON_VALUE
 			-- Convert to JSON value
-		do
-			create Result.make
-			Result.put (to_json_links (o.links), links_key)
-			if attached o.embedded_resource as l_embedded_resource then
-				Result.put (to_json_embedded_resource (l_embedded_resource), embedded_key)
-			end
-			if attached o.fields as l_properties then
-				from
-					l_properties.start
-				until
-					l_properties.after
-				loop
-					Result.put (json.value (l_properties.item_for_iteration), l_properties.key_for_iteration)
-					l_properties.forth
-				end
-			end
-		end
-
-feature {NONE} -- Converter implementation
-
-	to_json_embedded_resource (an_embedded_resource: HASH_TABLE [LIST [HAL_RESOURCE], STRING]): JSON_OBJECT
-		do
-			create Result.make
-			from
-				an_embedded_resource.start
-			until
-				an_embedded_resource.after
-			loop
-				Result.put (to_json_embedded_resource_internal (an_embedded_resource.item_for_iteration), an_embedded_resource.key_for_iteration)
-				an_embedded_resource.forth
-			end
-		end
-
-	to_json_embedded_resource_internal (a_resource: LIST [HAL_RESOURCE]): JSON_VALUE
-		local
-			l_result_arr: JSON_ARRAY
-		do
-			if a_resource.count = 1 then
-				create {JSON_OBJECT} Result.make
-				if attached to_json (a_resource.at (1)) as l_res then
-					Result := l_res
-				end
-			else
-				create {JSON_ARRAY} l_result_arr.make_empty
-				from
-					a_resource.start
-				until
-					a_resource.after
-				loop
-					if attached to_json (a_resource.item_for_iteration) as l_iter then
-						l_result_arr.add (l_iter)
-					end
-					a_resource.forth
-				end
-				Result := l_result_arr
-			end
-		end
-
-	to_json_links (a_links: HASH_TABLE [HAL_LINK, STRING]): JSON_OBJECT
-		do
-			create Result.make
-			from
-				a_links.start
-			until
-				a_links.after
-			loop
-				if a_links.key_for_iteration.is_case_insensitive_equal (curies_key.item) then
-					Result.put (to_json_link_curies (a_links.item_for_iteration), a_links.key_for_iteration)
-				else
-					Result.put (to_json_link_internal (a_links.item_for_iteration), a_links.key_for_iteration)
-				end
-				a_links.forth
-			end
-		end
-
-	to_json_link_internal (a_link: HAL_LINK): JSON_VALUE
-		local
-			l_result_arr: JSON_ARRAY
-		do
-			if a_link.attributes.count = 1 then
-				Result := to_json_link_attribute (a_link.attributes.first)
-			else
-				create {JSON_ARRAY} l_result_arr.make_empty
-				from
-					a_link.attributes.start
-				until
-					a_link.attributes.after
-				loop
-					l_result_arr.add (to_json_link_attribute (a_link.attributes.item_for_iteration))
-					a_link.attributes.forth
-				end
-				Result := l_result_arr
-			end
-		end
-
-	to_json_link_curies (a_link: HAL_LINK): JSON_VALUE
 		local
-			l_result_arr: JSON_ARRAY
+			ser: HAL_RESOURCE_JSON_SERIALIZER
+			ctx: JSON_SERIALIZER_CONTEXT
 		do
-			create {JSON_ARRAY} l_result_arr.make_empty
-			from
-				a_link.attributes.start
-			until
-				a_link.attributes.after
-			loop
-				l_result_arr.add (to_json_link_attribute (a_link.attributes.item_for_iteration))
-				a_link.attributes.forth
-			end
-			Result := l_result_arr
-		end
-
-	to_json_link_attribute (a_link_attribute: HAL_LINK_ATTRIBUTE): JSON_OBJECT
-		do
-			create Result.make
-			if attached a_link_attribute.name as l_name then
-				Result.put (json.value (a_link_attribute.name), name_key)
-			end
-			Result.put (json.value (a_link_attribute.href), href_key)
-			if attached a_link_attribute.hreflang as l_hreflang then
-				Result.put (json.value (a_link_attribute.hreflang), hreflang_key)
-			end
-			if attached a_link_attribute.title as l_title then
-				Result.put (json.value (a_link_attribute.title), title_key)
-			end
-			if attached a_link_attribute.templated as l_templated then
-				Result.put (json.value (a_link_attribute.templated), templated_key)
-			end
-			if attached a_link_attribute.deprecation as l_deprecation then
-				Result.put (json.value (a_link_attribute.deprecation), deprecation_key)
-			end
-			if attached a_link_attribute.type as l_type then
-				Result.put (json.value (a_link_attribute.type), type_key)
-			end
-			if attached a_link_attribute.profile as l_profile then
-				Result.put (json.value (a_link_attribute.profile), profile_key)
-			end
-
-		end
-
-	from_json_link (j: attached like value): HASH_TABLE [HAL_LINK, STRING]
-		local
-			l_keys: ARRAY [JSON_STRING]
-			js: JSON_STRING
-			i, k: INTEGER
-			l_link: HAL_LINK
-		do
-			create Result.make (2)
-			from
-				i := 1
-				l_keys := j.current_keys
-			until
-				i > l_keys.count
-			loop
-				js := l_keys [i]
-				if
-					attached {JSON_OBJECT} j.item (js) as jo and then
-					attached create_link_attributes (jo) as la
-				then
-					create l_link.make_with_attribute (js.item, la)
-					Result.force (l_link, js.item)
-				elseif attached {JSON_ARRAY} j.item (js) as ja then
-					create l_link.make (l_keys [i].item)
-					from
-						k := 1
-					until
-						k > ja.count
-					loop
-						if
-							attached {JSON_OBJECT} ja.i_th (k) as ji and then
-							attached create_link_attributes (ji) as lai
-						then
-							l_link.add_attribute (lai)
-						end
-						k := k + 1
-					end
-					Result.force (l_link, js.item)
-				end
-				i := i + 1
-			end
-		end
-
-	create_link_attributes (j: JSON_OBJECT): detachable HAL_LINK_ATTRIBUTE
-			-- create an object LINK_ATTRIBUTE from a JSON_OBJECT
-		do
-				--|TODO refactor to make it simpler
-			if attached {JSON_STRING} j.item (href_key) as j_href then
-				create Result.make (j_href.item)
-				if attached {JSON_STRING} j.item (name_key) as j_name then
-					Result.set_name (j_name.item)
-				end
-				if attached {JSON_STRING} j.item (title_key) as j_title then
-					Result.set_title (j_title.item)
-				end
-				if attached {JSON_STRING} j.item (hreflang_key) as j_hreflang then
-					Result.set_hreflang (j_hreflang.item)
-				end
-				if attached {JSON_BOOLEAN} j.item (templated_key) as j_templated then
-					Result.set_templated (j_templated.item)
-				end
-				if attached {JSON_STRING} j.item (type_key) as j_type then
-					Result.set_type (j_type.item)
-				end
-				if attached {JSON_STRING} j.item (deprecation_key) as j_deprecation then
-					Result.set_deprecation (j_deprecation.item)
-				end
-				if attached {JSON_STRING} j.item (profile_key) as j_profile then
-					Result.set_profile (j_profile.item)
-				end
-			end
-		end
-
-feature {NONE} -- Implementation: RESOURCE
-
-	links_key: JSON_STRING
-		once
-			create Result.make_from_string ("_links")
-		end
-
-	embedded_key: JSON_STRING
-		once
-			create Result.make_from_string ("_embedded")
-		end
-
-feature {NONE} -- Implementation: LINK
-
-	href_key: JSON_STRING
-		once
-			create Result.make_from_string ("href")
-		end
-
-	ref_key: JSON_STRING
-		once
-			create Result.make_from_String ("ref")
-		end
-
-feature {NONE} -- Implementation: LINK_ATTRIBUTE
-
-	name_key: JSON_STRING
-		once
-			create Result.make_from_string("name")
-		end
-
-	title_key: JSON_STRING
-		once
-			create Result.make_from_string ("title")
-		end
-
-	hreflang_key: JSON_STRING
-		once
-			create Result.make_from_string ("hreflang")
-		end
-
-	templated_key: JSON_STRING
-		once
-			create Result.make_from_string ("templated")
-		end
-
-	type_key: JSON_STRING
-		once
-			create Result.make_from_string ("type")
-		end
-
-	deprecation_key: JSON_STRING
-		once
-			create Result.make_from_string ("deprecation")
-		end
-
-	profile_key: JSON_STRING
-		once
-			create Result.make_from_string ("profile")
-		end
-
-	curies_key: JSON_STRING
-		once
-			create Result.make_from_string ("curies")
+			create ser
+			create ctx
+			Result := ser.to_json (o, ctx)
 		end
 
 end
diff --git a/library/hal.rc b/library/hal.rc
deleted file mode 100644
index b0ec159..0000000
--- a/library/hal.rc
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <windows.h>
-
-STRINGTABLE
-BEGIN
-	1 "This Program was made using EiffelStudio using Visual Studio C++"
-END
diff --git a/library/hal_access.e b/library/hal_access.e
new file mode 100644
index 0000000..1f82eca
--- /dev/null
+++ b/library/hal_access.e
@@ -0,0 +1,9 @@
+note
+	description: "Summary description for {HAL_ACCESS}."
+	date: "$Date$"
+	revision: "$Revision$"
+
+deferred class
+	HAL_ACCESS
+
+end
diff --git a/library/hal_link_attribute.e b/library/hal_link_attribute.e
index fcea24a..f500801 100644
--- a/library/hal_link_attribute.e
+++ b/library/hal_link_attribute.e
@@ -15,7 +15,7 @@ feature {NONE} -- Initialization
 
 	make (a_ref: STRING)
 			-- Create a link attribute with an href and
-			-- set if it's a tempalted uri or just a uri.
+			-- set if it's a templated uri or just a uri.
 		do
 			set_href (a_ref)
 			set_templated (is_uri_template)
@@ -63,7 +63,7 @@ feature -- Access
 			-- Its value is a string which is a URI that hints about the profile (as
    			-- defined by [I-D.wilde-profile-link]) of the target resource.	
 
-	title: detachable STRING
+	title: detachable READABLE_STRING_32
 			--@title
 			--OPTIONAL
 			--For labeling the destination of a link with a human-readable identifier.
@@ -123,10 +123,10 @@ feature -- Element change
 			profile_set: profile = a_profile
 		end
 
-	set_title (a_title: STRING)
+	set_title (a_title: READABLE_STRING_GENERAL)
 			-- Set title with `a_title'
 		do
-			title := a_title
+			create {STRING_32} title.make_from_string_general (a_title)
 		ensure
 			assigned: title = a_title
 		end
@@ -139,7 +139,6 @@ feature -- Element change
 			assigned: hreflang = a_hreflang
 		end
 
-
 feature {NONE} -- Implementation
 
 	is_uri_template: BOOLEAN
diff --git a/library/hal_resource.e b/library/hal_resource.e
index 37088b6..dd46530 100644
--- a/library/hal_resource.e
+++ b/library/hal_resource.e
@@ -54,8 +54,6 @@ feature -- Access
 			valid: Result /= Void
 		end
 
-
-
 	curies: detachable HAL_LINK
 			-- Return the curies link
 			-- For example if you have the following JSON representation
@@ -82,7 +80,7 @@ feature -- Access
 		end
 
 
-	links_keys: ARRAY [STRING]
+	links_keys: ARRAY [READABLE_STRING_GENERAL]
 			-- Return an array of keys, ie rel attributes
 			-- For example if you have the following JSON representation
 			--
@@ -100,7 +98,7 @@ feature -- Access
 			Result := links.current_keys
 		end
 
-	links_by_key (a_key: STRING): detachable HAL_LINK
+	links_by_key (a_key: READABLE_STRING_GENERAL): detachable HAL_LINK
 			-- Retrieve a link given a `a_key', ie a rel attribute if it exist,
 			-- Void in othercase
 			-- For example if you have the following JSON representation
@@ -119,7 +117,7 @@ feature -- Access
 			Result := links.at (a_key)
 		end
 
-	embedded_resources_keys: detachable ARRAY [STRING]
+	embedded_resources_keys: detachable ARRAY [READABLE_STRING_GENERAL]
 			-- Retrieve an arrray of resource keys, if exist,
 			-- Void in othercase
 		do
@@ -128,15 +126,15 @@ feature -- Access
 			end
 		end
 
-	embedded_resources_by_key (a_key: STRING): detachable LIST [HAL_RESOURCE]
+	embedded_resources_by_key (a_key: READABLE_STRING_GENERAL): detachable LIST [HAL_RESOURCE]
 			-- Return a list embedded resources if it exist or Void in other case
 		do
 			if attached embedded_resource as er then
-				Result := er.at (a_key)
+				Result := er [a_key]
 			end
 		end
 
-	fields_keys: detachable ARRAY [STRING]
+	fields_keys: detachable ARRAY [READABLE_STRING_GENERAL]
 			-- Return an array of fields keys if exist,
 			-- Void in othercase
 		do
@@ -145,30 +143,29 @@ feature -- Access
 			end
 		end
 
-	fields_by_key (a_key: STRING): detachable STRING
+	fields_by_key (a_key: READABLE_STRING_GENERAL): detachable READABLE_STRING_32
 			-- Return a string value, if key `a_key' exists
 			-- Void in othercase
 		do
-			if attached fields as p then
-				Result := p.at (a_key)
+			if attached fields as l_fields then
+				Result := l_fields [a_key]
 			end
 		end
 
 feature -- Element Change
 
-	add_all_links (all_link: HASH_TABLE [HAL_LINK, STRING])
+	add_all_links (all_link: STRING_TABLE [HAL_LINK])
 		do
-			links.copy (all_link)
+			across
+				all_link as ic
+			loop
+				add_link_with_key (ic.key, ic.item)
+			end
 		end
 
-	add_link_with_key (a_key: STRING; a_link: HAL_LINK)
+	add_link_with_key (a_key: READABLE_STRING_GENERAL; a_link: HAL_LINK)
 			-- add an (a_key,a_link) pair
 			-- require a_key is_equal a_link.rel
-		do
-			links.force (a_link, a_key)
-		end
-
-	add_link (a_link: HAL_LINK)
 		local
 			l_links: like links
 		do
@@ -177,48 +174,48 @@ feature -- Element Change
 				create l_links.make (10)
 				l_links.compare_objects
 				links := l_links
+			elseif
+				l_links.has (a_link.rel) and then
+				attached {HAL_LINK} l_links [a_link.rel] as l_hal
+			then
+				l_hal.attributes.append (a_link.attributes)
+				l_links := Void
 			end
-			if l_links.has (a_link.rel) then
-				if attached {HAL_LINK} l_links.at (a_link.rel) as l_hal then
-					l_hal.attributes.append (a_link.attributes)
-				end
-			else
-				l_links.force (a_link, a_link.rel)
+			if l_links /= Void then
+				l_links.force (a_link, a_key)
 			end
 		end
 
+	add_link (a_link: HAL_LINK)
+		do
+			add_link_with_key (a_link.rel, a_link)
+		end
+
 	add_curie_link (a_attribute: HAL_LINK_ATTRIBUTE)
-		local
-			l_links: like links
 		do
-			l_links := links
-			if l_links = Void then
-				create l_links.make (10)
-				l_links.compare_objects
-				links := l_links
-			end
-			if l_links.has ("curies") then
-				if attached {HAL_LINK} l_links.at ("curies") as l_hal then
-					l_hal.attributes.force (a_attribute)
-				end
-			else
-				l_links.force (create {HAL_LINK}.make_with_attribute ("curies",a_attribute), "curies")
-			end
+			add_link_with_key ("curies", create {HAL_LINK}.make_with_attribute ("curies", a_attribute))
+		end
+
+	add_fields (key: READABLE_STRING_GENERAL; value: READABLE_STRING_GENERAL)
+		obsolete
+			"Use `add_field` [2017-06-20]"
+		do
+			add_field (key, value)
 		end
 
-	add_fields (key: STRING; value: STRING)
+	add_field (key: READABLE_STRING_GENERAL; value: READABLE_STRING_GENERAL)
 		local
 			l_fields: like fields
 		do
 			l_fields := fields
 			if l_fields = Void then
-				create l_fields.make (5)
+				create l_fields.make (1)
 				fields := l_fields
 			end
-			l_fields.force (value, key)
+			l_fields.force (value.to_string_32, key)
 		end
 
-	add_embedded_resource_with_key (key: STRING; res: HAL_RESOURCE)
+	add_embedded_resource_with_key (key: READABLE_STRING_GENERAL; res: HAL_RESOURCE)
 		local
 			er: like embedded_resource
 		do
@@ -233,7 +230,7 @@ feature -- Element Change
 			end
 		end
 
-	add_embedded_resources_with_key (key: STRING; resources: LIST [HAL_RESOURCE])
+	add_embedded_resources_with_key (key: READABLE_STRING_GENERAL; resources: LIST [HAL_RESOURCE])
 		local
 			er: like embedded_resource
 		do
@@ -255,15 +252,15 @@ feature -- Status Report
 			Result := links.has_key ("self") or else links.is_empty
 		end
 
-feature {JSON_HAL_RESOURCE_CONVERTER} -- Implementation
+feature {HAL_ACCESS} -- Implementation
 
-	links: HASH_TABLE [HAL_LINK, STRING]
+	links: STRING_TABLE [HAL_LINK]
 			--  contains links to other resources.
 
-	embedded_resource: detachable HASH_TABLE [LIST [HAL_RESOURCE], STRING]
+	embedded_resource: detachable STRING_TABLE [LIST [HAL_RESOURCE]]
 			-- expressing the embedded nature of a given part of the representation.
 
-	fields: detachable HASH_TABLE [STRING, STRING]
-			-- properties that represent the current state of the resource
+	fields: detachable STRING_TABLE [READABLE_STRING_32]
+			-- Properties representing current state of Current resource.
 
 end
diff --git a/package.iron b/package.iron
new file mode 100644
index 0000000..f620092
--- /dev/null
+++ b/package.iron
@@ -0,0 +1,21 @@
+package hal
+
+project
+	hal = "library/hal.ecf"
+
+note
+	title: HAL
+	description: "[
+Eiffel HAL is a library to work with  http://stateless.co/hal_specification.html#json
+HAL is used for exposing RESTful hypermedia APIs.
+Right now the current implementation only support JSON_HAL.
+				]"
+
+	tags: api, rest, hypermedia, media-type
+	license: Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)
+	link[license]: http://www.eiffel.com/licensing/forum.txt
+	link[source]: "svn" https://svn.eiffel.com/eiffelstudio/trunk/Src/contrib/library/web/communication/mediatype/hal/
+	link[doc]: "Documentation" http://tools.ietf.org/html/draft-kelly-json-hal-07
+	link[examples]: "Api examples" https://github.com/mikekelly/hal_specification/wiki/APIs
+
+end
diff --git a/test/application.e b/test/application.e
index 2f9075d..31a9946 100644
--- a/test/application.e
+++ b/test/application.e
@@ -1,14 +1,14 @@
 note
 	description: "HAL application root class"
-	date: "$Date$"
-	revision: "$Revision$"
+	date: "$Date: 2017-06-20 16:23:13 +0200 (mar., 20 juin 2017) $"
+	revision: "$Revision: 100528 $"
 
 class
 	APPLICATION
 
-inherit
+--inherit
 
-	SHARED_EJSON
+--	SHARED_EJSON
 
 create
 	make
@@ -16,36 +16,27 @@ create
 feature {NONE} -- Initialization
 
 	make
-		local
---			hlink : LINK
---			hresource : RESOURCE
-			order: ORDER
-			js_cc: JSON_CUSTOMER_CONVERTER
-			js_ic: JSON_ITEM_CONVERTER
-			js_li: JSON_LINE_ITEM_CONVERTER
-			js_oc: JSON_ORDER_CONVERTER
 		do
 			create file_reader
 --			test_json_min
 --			test_json_hal
 --			test_json_link
 --			test_hal
---			test_item_line_item
---			test_order
+			test_item_line_item
+			test_order
 
---			example_from_hal_to_domain
+			example_from_hal_to_domain
 			test_build_hal_json
 		end
 
 	test_build_hal_json
 		local
-			l_hal: JSON_HAL_RESOURCE_CONVERTER
+			conv: JSON_HAL_RESOURCE_CONVERTER
 			l_res: HAL_RESOURCE
 			l_link: HAL_LINK
 			l_attribute: HAL_LINK_ATTRIBUTE
 		do
-			create l_hal.make
-			json.add_converter (l_hal)
+			create conv.make
 			create l_attribute.make ("/orders?{id}")
 			l_attribute.set_name ("orders")
 
@@ -63,44 +54,45 @@ feature {NONE} -- Initialization
 
 			print ("%Nis_valid_resource:" + l_res.is_valid_resource.out )
 			io.put_new_line
-			if attached json.value (l_res) as ll_hal then
-				print (ll_hal.representation)
+			if attached conv.to_json (l_res) as j then
+				print (j.representation)
+
+				if attached conv.from_json (j) as hal then
+					print (hal)
+					print (friendly_output (hal))
+				end
 			end
+		end
 
+	friendly_output (obj: detachable ANY): STRING
+		local
+			serial: JSON_REFLECTOR_SERIALIZER
+			ctx: JSON_SERIALIZER_CONTEXT
+		do
+			create ctx
+			ctx.set_pretty_printing
+			ctx.set_is_type_name_included (False)
+			ctx.register_serializer (create {TABLE_ITERABLE_JSON_SERIALIZER [detachable ANY, READABLE_STRING_GENERAL]}, {TABLE [detachable ANY, READABLE_STRING_GENERAL]})
+			ctx.register_serializer (create {ITERABLE_JSON_SERIALIZER [detachable ANY]}, {ITERABLE [detachable ANY]})
+			ctx.set_default_serializer (create {JSON_REFLECTOR_SERIALIZER})
+			create serial
+			Result := serial.to_json_string (obj, ctx)
 		end
 
 	example_from_hal_to_domain
 		local
-			js_ic : JSON_ITEM_CONVERTER
-			js_li : JSON_LINE_ITEM_CONVERTER
-			js_cc : JSON_CUSTOMER_CONVERTER
-			js_oc : JSON_ORDER_CONVERTER
 			js_hal:  JSON_HAL_RESOURCE_CONVERTER
-			l_item : ITEM
-			line:LINE_ITEM
-			l_cust : CUSTOMER
-			l_order : ORDER
 			l_res : HAL_RESOURCE
-			l_total : REAL
 			l_currency : STRING
 			l_status : STRING
 			l_placed : STRING
-
 		do
-			create js_ic.make
-			create js_li.make
-			create js_oc.make
-			create js_cc.make
 			create js_hal.make
-			json.add_converter (js_ic)
-			json.add_converter (js_li)
-			json.add_converter (js_oc)
-			json.add_converter (js_cc)
-			json.add_converter (js_hal)
+
 			if attached json_file_from ("hal_example.json") as json_file then
 				if attached {JSON_OBJECT} json_value_from_file (json_file) as jo then
-					if attached {HAL_RESOURCE} json.object (jo, "HAL_RESOURCE") as r then
-					    if attached {ARRAYED_LIST[HAL_RESOURCE]} r.embedded_resources_by_key ("order") as l_r then
+					if attached {HAL_RESOURCE} js_hal.from_json (jo) as r then
+					    if attached {ARRAYED_LIST [HAL_RESOURCE]} r.embedded_resources_by_key ("order") as l_r then
 							from
 								l_r.start
 							until
@@ -108,98 +100,98 @@ feature {NONE} -- Initialization
 							loop
 								l_res:= l_r.item_for_iteration
 
-					            if attached {STRING} l_res.fields_by_key("currency") as l_ucs then
+					            if attached {STRING} l_res.fields_by_key ("currency") as l_ucs then
 					            	l_currency := l_ucs
-					            	print ("Currency:" + l_currency )
+					            	print ("Currency:" + l_currency)
+					            	io.put_new_line
 					            end
 
 					            if attached {STRING} l_res.fields_by_key ("status") as l_ucs then
 					            	l_status := l_ucs
 									print ("Status:" + l_status )
+									io.put_new_line
 								end
 
 								if attached {STRING} l_res.fields_by_key ("placed") as l_ucs then
 					            	l_placed := l_ucs
 					            	print ("Placed:" + l_placed )
+					            	io.put_new_line
 								end
 
-
-
 								l_r.forth
 							end
 					    end
-
 					end
 				end
 			end
-
-
 		end
 
 	test_order
 		local
-			js_ic: JSON_ITEM_CONVERTER
-			js_li: JSON_LINE_ITEM_CONVERTER
-			js_cc: JSON_CUSTOMER_CONVERTER
-			js_oc: JSON_ORDER_CONVERTER
 			l_item: ITEM
 			line: LINE_ITEM
 			l_cust: CUSTOMER
 			l_order: ORDER
+			serial: JSON_SERIALIZATION
+			ctx: JSON_SERIALIZATION_CONTEXT
 		do
-			create js_ic.make
-			create js_li.make
-			create js_oc.make
-			create js_cc.make
-			json.add_converter (js_ic)
-			json.add_converter (js_li)
-			json.add_converter (js_oc)
-			json.add_converter (js_cc)
+			create ctx
+			create serial.make_with_context (ctx)
+			ctx.register (create {JSON_ITEM_CONVERTER}, {ITEM})
+			ctx.register (create {JSON_LINE_ITEM_CONVERTER}, {LINE_ITEM})
+			ctx.register (create {JSON_ORDER_CONVERTER}, {ORDER})
+			ctx.register (create {JSON_CUSTOMER_CONVERTER}, {CUSTOMER})
+
 			create line.make ("basket")
 			create l_item.make ("ABCD123", 2, 9.5)
 			line.add_item (l_item)
 			create l_item.make ("GFZ111", 1, 11)
 			line.add_item (l_item)
+
 			create l_cust.make ("Javier", "test@hal.com")
 			create l_order.make ("test", "USD", "Placed", l_cust)
-			l_order.add_item (l_item)
-			if attached {JSON_VALUE} json.value (l_order) as jv then
+			across
+				line.items as ic
+			loop
+				l_order.add_item (ic.item)
+			end
+
+			if attached {JSON_VALUE} serial.to_json (l_order) as jv then
 				print (jv.representation)
 			end
 		end
 
 	test_item_line_item
 		local
-			js_ic: JSON_ITEM_CONVERTER
-			js_li: JSON_LINE_ITEM_CONVERTER
 			l_item: ITEM
 			line: LINE_ITEM
+			serial: JSON_SERIALIZATION
+			ctx: JSON_SERIALIZATION_CONTEXT
 		do
-			create js_ic.make
-			create js_li.make
-			json.add_converter (js_ic)
-			json.add_converter (js_li)
+			create ctx
+			create serial.make_with_context (ctx)
+			ctx.register (create {JSON_ITEM_CONVERTER}, {ITEM})
+			ctx.register (create {JSON_LINE_ITEM_CONVERTER}, {LINE_ITEM})
 			create line.make ("basket")
 			create l_item.make ("ABCD123", 2, 9.5)
 			line.add_item (l_item)
 			create l_item.make ("GFZ111", 1, 11)
 			line.add_item (l_item)
-			if attached {JSON_VALUE} json.value (line) as jv then
+			if attached {JSON_VALUE} serial.to_json (line) as jv then
 				print (jv.representation)
 			end
 		end
 
 	test_hal
 		local
-			hal: JSON_HAL_RESOURCE_CONVERTER
+			conv: JSON_HAL_RESOURCE_CONVERTER
 		do
-			create hal.make
-			json.add_converter (hal)
+			create conv.make
 			if attached json_file_from ("hal_example.json") as json_file then
 				if attached {JSON_OBJECT} json_value_from_file (json_file) as jo then
-					if attached {HAL_RESOURCE} json.object (jo, "HAL_RESOURCE") as r then
+					if attached {HAL_RESOURCE} conv.from_json (jo) as r then
 						print (r.out)
-						if attached json.value (r) as jv then
+						if attached conv.to_json (r) as jv then
 							print (jv.representation)
 						end
 						if attached r.self as l_link then
@@ -266,7 +258,7 @@ feature -- Implementation
 
 	new_json_parser (a_string: STRING): JSON_PARSER
 		do
-			create Result.make_parser (a_string)
+			create Result.make_with_string (a_string)
 		end
 
 	json_value_from_file (json_file: STRING): detachable JSON_VALUE
@@ -274,10 +266,12 @@ feature -- Implementation
 			p: like new_json_parser
 		do
 			p := new_json_parser (json_file)
-			Result := p.parse_json
+			p.parse_content
 			check
 				json_is_parsed: p.is_parsed
 			end
+
+			Result := p.parsed_json_value
 		end
 
 end
diff --git a/test/converter/json_customer_converter.e b/test/converter/json_customer_converter.e
index ae454c4..608b0b4 100644
--- a/test/converter/json_customer_converter.e
+++ b/test/converter/json_customer_converter.e
@@ -1,70 +1,61 @@
 note
 	description: "Summary description for {JSON_CUSTOMER_CONVERTER}."
 	author: ""
-	date: "$Date$"
-	revision: "$Revision$"
+	date: "$Date: 2017-06-20 16:23:13 +0200 (mar., 20 juin 2017) $"
+	revision: "$Revision: 100528 $"
 
 class
 	JSON_CUSTOMER_CONVERTER
-inherit
-    JSON_CONVERTER
-
-create
-    make
-
-feature {NONE} -- Initialization
 
-    make
-        local
-            l_name: STRING_32
-            l_email: STRING_32
-        do
-            create l_name.make_from_string ("")
-            create l_email.make_from_string ("")
-            create object.make (l_name,l_email)
-        end
-
-feature -- Access
-
-    object: CUSTOMER
+inherit
+	JSON_SERIALIZER
+	JSON_DESERIALIZER
 
 feature -- Conversion
 
-    from_json (j: like to_json): detachable like object
-        local
-            l_name: detachable STRING_32
-            l_email : detachable STRING_32
-        do
-            if attached {STRING_32} json.object (j.item (name_key), Void) as l_ucs then
-            	l_name := l_ucs
-            end
-
-            if attached {STRING_32} json.object (j.item (email_key), Void) as l_ucs then
-            	l_email := l_ucs
-            end
-
-            check l_email /= Void end
-            check l_name /= Void end
-            create Result.make (l_name, l_email)
-        end
-
-    to_json (o: like object): JSON_OBJECT
-        do
-            create Result.make
-            Result.put (json.value (o.name), name_key)
-            Result.put (json.value (o.email), email_key)
-        end
-
-feature    {NONE} -- Implementation
-
-    name_key: JSON_STRING
-        once
-            create Result.make_from_string ("name")
-        end
-
-    email_key: JSON_STRING
-        once
-            create Result.make_from_string ("email")
-        end
+	to_json (obj: detachable ANY; ctx: JSON_SERIALIZER_CONTEXT): JSON_VALUE
+		local
+			jo: JSON_OBJECT
+		do
+			if attached {CUSTOMER} obj as o then
+				create jo.make
+				jo.put_string (o.name, name_key)
+				jo.put_string (o.email, email_key)
+				Result := jo
+			else
+				create {JSON_NULL} Result
+			end
+		end
+
+	from_json (a_json: detachable JSON_VALUE; ctx: JSON_DESERIALIZER_CONTEXT; a_type: detachable TYPE [detachable ANY]): detachable CUSTOMER
+		do
+			if attached {JSON_OBJECT} a_json as jo then
+				if
+					attached {JSON_STRING} jo.item (name_key) as l_name and
+					attached {JSON_STRING} jo.item (email_key) as l_email
+				then
+					create Result.make (l_name.unescaped_string_32, l_email.unescaped_string_8)
+				else
+					check
+						has_name: False
+					end
+					check
+						has_email: False
+					end
+				end
+			end
+		end
+
+feature {NONE} -- Implementation
+
+	name_key: JSON_STRING
+		once
+			create Result.make_from_string ("name")
+		end
+
+	email_key: JSON_STRING
+		once
+			create Result.make_from_string ("email")
+		end
 
 end -- class JSON_CUSTOMER_CONVERTER
diff --git a/test/converter/json_item_converter.e b/test/converter/json_item_converter.e
index 842cda9..ab7d7ac 100644
--- a/test/converter/json_item_converter.e
+++ b/test/converter/json_item_converter.e
@@ -1,61 +1,52 @@
 note
 	description: "Summary description for {JSON_ITEM_CONVERTER}."
 	author: ""
-	date: "$Date$"
-	revision: "$Revision$"
+	date: "$Date: 2017-06-20 16:23:13 +0200 (mar., 20 juin 2017) $"
+	revision: "$Revision: 100528 $"
 
 class
 	JSON_ITEM_CONVERTER
-inherit
-    JSON_CONVERTER
-
-create
-    make
-
-feature {NONE} -- Initialization
-
-    make
-        local
-            l_id: STRING_32
-        do
-            create l_id.make_from_string ("")
-            create object.make (l_id,0,0.0)
-        end
-
-feature -- Access
 
-    object: ITEM
+inherit
+	JSON_SERIALIZER
+	JSON_DESERIALIZER
 
 feature -- Conversion
 
-    from_json (j: like to_json): detachable like object
+	from_json (a_json: detachable JSON_VALUE; ctx: JSON_DESERIALIZER_CONTEXT; a_type: detachable TYPE [detachable ANY]): detachable ITEM
         local
-            l_id: detachable STRING_32
             l_quantity : NATURAL
             l_price : REAL
         do
-            if attached {STRING_32} json.object (j.item (id_key), Void) as l_ucs then
-            	l_id := l_ucs
-            end
-
-            if attached {NATURAL} json.object (j.item (quantity_key), Void) as l_ucs then
-            	l_quantity := l_ucs
-            end
-
-            if attached {REAL} json.object (j.item (quantity_key), Void) as l_ucs then
-            	l_price := l_ucs
-			end
-
-            check l_id /= Void end
-            create Result.make (l_id, l_quantity, l_price)
+        	if attached {JSON_OBJECT} a_json as j then
+	            if attached {JSON_STRING} j.item (id_key) as l_id then
+
+		            if attached {JSON_NUMBER} j.item (quantity_key) as l_ucs then
+		            	l_quantity := l_ucs.natural_64_item.to_natural_32
+		            end
+		            if attached {JSON_NUMBER} j.item (price_key) as l_ucs then
+		            	l_price := l_ucs.real_64_item.truncated_to_real
+					end
+	            	create Result.make (l_id.unescaped_string_8, l_quantity, l_price)
+	            else
+	            	check has_id: False end
+	            end
+        	end
         end
 
-    to_json (o: like object): JSON_OBJECT
+	to_json (obj: detachable ANY; ctx: JSON_SERIALIZER_CONTEXT): JSON_VALUE
+		local
+			jo: JSON_OBJECT
         do
-            create Result.make
-            Result.put (json.value (o.id), id_key)
-            Result.put (json.value (o.quantity), quantity_key)
-            Result.put (json.value (o.price), price_key)
+        	if attached {ITEM} obj as o then
+	            create jo.make
+	            jo.put_string (o.id, id_key)
+	            jo.put_natural (o.quantity, quantity_key)
+	            jo.put_real (o.price, price_key)
+				Result := jo
+        	else
+        		create {JSON_NULL} Result
+        	end
         end
 
 feature    {NONE} -- Implementation
diff --git a/test/converter/json_line_item_converter.e b/test/converter/json_line_item_converter.e
index 5c9379c..19a3d54 100644
--- a/test/converter/json_line_item_converter.e
+++ b/test/converter/json_line_item_converter.e
@@ -1,80 +1,86 @@
-note
-	description: "Summary description for {JSON_LINE_ITEM_CONVERTER}."
-	author: ""
-	date: "$Date$"
-	revision: "$Revision$"
-
-class
-	JSON_LINE_ITEM_CONVERTER
-
-inherit
-	JSON_CONVERTER
-
-create
-	make
-
-feature {NONE} -- Initialization
-
-	make
-		do
-			create object.make ("")
-		end
-
-feature -- Access
-
-	object: LINE_ITEM
-
-feature -- Conversion
-
-	from_json (j: like to_json): detachable like object
-		local
-			ll: LINKED_LIST [ITEM]
-			i: INTEGER
-		do
-			if attached {STRING_32} json.object (j.item (name_key), Void) as ucs then
-				if attached {JSON_ARRAY} j.item (items_key) as ja then
-					create Result.make (ucs)
-					from
-						i := 1
-						create ll.make
-					until
-						i > ja.count
-					loop
-						if attached {ITEM} json.object (ja [i], "ITEM") as b then
-							ll.force (b)
-						end
-						i := i + 1
-					end
-					Result.add_items (ll)
-				else
-					check
-						has_array_items: False
-					end
-				end
-			else
-				check
-					has_name_key: False
-				end
-			end
-		end
-
-	to_json (o: like object): JSON_OBJECT
-		do
-			create Result.make
-				--Result.put (json.value (o.name), name_key)
-			Result.put (json.value (o.items), items_key)
-		end
-
-feature {NONE} -- Implementation
-
-	name_key: JSON_STRING
-		once
-			create Result.make_from_string ("name")
-		end
-
-	items_key: JSON_STRING
-		once
-			create Result.make_from_string ("items")
-		end
-
-end -- class JSON_LINE_ITEM_CONVERTER
+note
+	description: "Summary description for {JSON_LINE_ITEM_CONVERTER}."
+	author: ""
+	date: "$Date: 2017-06-20 16:23:13 +0200 (mar., 20 juin 2017) $"
+	revision: "$Revision: 100528 $"
+
+class
+	JSON_LINE_ITEM_CONVERTER
+
+inherit
+	JSON_SERIALIZER
+	JSON_DESERIALIZER
+
+feature -- Conversion
+
+	from_json (a_json: detachable JSON_VALUE; ctx: JSON_DESERIALIZER_CONTEXT; a_type: detachable TYPE [detachable ANY]): detachable LINE_ITEM
+		local
+			ll: LINKED_LIST [ITEM]
+			i: INTEGER
+		do
+			if
+				attached {JSON_OBJECT} a_json as j and then
+				attached {JSON_STRING} j.item (name_key) as ucs
+			then
+				if attached {JSON_ARRAY} j.item (items_key) as ja then
+					create Result.make (ucs.unescaped_string_32)
+					from
+						i := 1
+						create ll.make
+					until
+						i > ja.count
+					loop
+						if attached {ITEM} ctx.value_from_json (ja[i], {ITEM}) as b then
+							ll.force (b)
+						end
+						i := i + 1
+					end
+					Result.add_items (ll)
+				else
+					check
+						has_array_items: False
+					end
+				end
+			else
+				check
+					has_name_key: False
+				end
+			end
+		end
+
+	to_json (obj: detachable ANY; ctx: JSON_SERIALIZER_CONTEXT): JSON_VALUE
+		local
+			jo: JSON_OBJECT
+			ja: JSON_ARRAY
+		do
+			if attached {LINE_ITEM} obj as o then
+				create jo.make
+				jo.put_string (o.name, name_key)
+				create ja.make_empty
+				across
+					o.items as ic
+				loop
+					if attached ctx.to_json (ic.item, Void) as ji then
+						ja.add (ji)
+					end
+				end
+				jo.put (ja, items_key)
+				Result := jo
+			else
+				create {JSON_NULL} Result
+			end
+		end
+
+feature {NONE} -- Implementation
+
+	name_key: JSON_STRING
+		once
+			create Result.make_from_string ("name")
+		end
+
+	items_key: JSON_STRING
+		once
+			create Result.make_from_string ("items")
+		end
+
+end -- class JSON_LINE_ITEM_CONVERTER
diff --git a/test/converter/json_order_converter.e b/test/converter/json_order_converter.e
index 7ec85c9..c6423cc 100644
--- a/test/converter/json_order_converter.e
+++ b/test/converter/json_order_converter.e
@@ -1,118 +1,111 @@
-note
-	description: "Summary description for {JSON_ORDER_CONVERTER}."
-	author: ""
-	date: "$Date$"
-	revision: "$Revision$"
-
-class
-	JSON_ORDER_CONVERTER
-
-inherit
-	JSON_CONVERTER
-
-create
-	make
-
-feature {NONE} -- Initialization
-
-	make
-		local
-			l_c: CUSTOMER
-		do
-			create l_c.make ("", "")
-			create object.make ("", "", "", l_c)
-		end
-
-feature -- Access
-
-	object: ORDER
-
-feature -- Conversion
-
-	from_json (j: like to_json): detachable like object
-		local
-			l_id: INTEGER
-			l_currency: detachable STRING
-			l_status: detachable STRING
-			l_placed: detachable STRING
-			l_customer: detachable CUSTOMER
-			l_line_items: detachable LINE_ITEM
-		do
-			if attached {INTEGER} json.object (j.item (id_key), Void) as l_ucs then
-				l_id := l_ucs
-			end
-			if attached {STRING_32} json.object (j.item (currency_key), Void) as l_ucs then
-				l_currency := l_ucs
-			end
-			if attached {STRING_32} json.object (j.item (status_key), Void) as l_ucs then
-				l_status := l_ucs
-			end
-			if attached {STRING_32} json.object (j.item (placed_key), Void) as l_ucs then
-				l_placed := l_ucs
-			end
-			if attached {CUSTOMER} json.object (j.item (customer_key), "CUSTOMER") as l_ucs then
-				l_customer := l_ucs
-			end
-			if attached {LINE_ITEM} json.object (j.item (line_items_key), "LINE_ITEM") as l_ucs then
-				l_line_items := l_ucs
-			end
-			check
-				l_id > 0
-			end
-			check
-				l_currency /= Void and l_status /= Void and	l_customer /= Void and l_line_items /= Void and	l_placed /= Void
-			then
-				create Result.make (l_line_items.name, l_currency, l_status, l_customer)
-				Result.set_placed (l_placed)
-			end
-		end
-
-	to_json (o: like object): JSON_OBJECT
-		do
-			create Result.make
-			Result.put (json.value (o.id), id_key)
-			Result.put (json.value (o.currency), currency_key)
-			Result.put (json.value (o.placed), placed_key)
-			Result.put (json.value (o.status), status_key)
-			Result.put (json.value (o.customer), customer_key)
-			Result.put (json.value (o.line_items), line_items_key)
-		end
-
-feature {NONE} -- Implementation
-
-	id_key: JSON_STRING
-		once
-			create Result.make_from_string ("id")
-		end
-
-	name_key: JSON_STRING
-		once
-			create Result.make_from_string ("name")
-		end
-
-	currency_key: JSON_STRING
-		once
-			create Result.make_from_string ("currency")
-		end
-
-	status_key: JSON_STRING
-		once
-			create Result.make_from_string ("status")
-		end
-
-	placed_key: JSON_STRING
-		once
-			create Result.make_from_string ("placed")
-		end
-
-	customer_key: JSON_STRING
-		once
-			create Result.make_json ("customer")
-		end
-
-	line_items_key: JSON_STRING
-		once
-			create Result.make_json ("line_items")
-		end
-
-end
+note
+	description: "Summary description for {JSON_ORDER_CONVERTER}."
+	author: ""
+	date: "$Date: 2017-06-20 16:23:13 +0200 (mar., 20 juin 2017) $"
+	revision: "$Revision: 100528 $"
+
+class
+	JSON_ORDER_CONVERTER
+
+inherit
+	JSON_SERIALIZER
+	JSON_DESERIALIZER
+
+feature -- Conversion
+
+	from_json (a_json: detachable JSON_VALUE; ctx: JSON_DESERIALIZER_CONTEXT; a_type: detachable TYPE [detachable ANY]): detachable ORDER
+		local
+			l_id: INTEGER
+			l_currency: detachable STRING
+			l_status: detachable STRING
+			l_placed: detachable STRING
+			l_customer: detachable CUSTOMER
+			l_line_items: detachable LINE_ITEM
+		do
+			if attached {JSON_OBJECT} a_json as j then
+				if attached {JSON_NUMBER} j.item (id_key) as l_ucs then
+					l_id := l_ucs.integer_64_item.to_integer_32
+				end
+				if attached {JSON_STRING} j.item (currency_key) as l_ucs then
+					l_currency := l_ucs.unescaped_string_32
+				end
+				if attached {JSON_STRING} j.item (status_key) as l_ucs then
+					l_status := l_ucs.unescaped_string_32
+				end
+				if attached {JSON_STRING} j.item (placed_key) as l_ucs then
+					l_placed := l_ucs.unescaped_string_32
+				end
+				if attached {CUSTOMER} ctx.value_from_json (j.item (customer_key), {CUSTOMER}) as c then
+					l_customer := c
+				end
+				if attached {LINE_ITEM} ctx.value_from_json (j.item (line_items_key), {LINE_ITEM}) as li then
+					l_line_items := li
+				end
+				check
+					l_id > 0
+				end
+				check
+					l_currency /= Void and l_status /= Void and	l_customer /= Void and l_line_items /= Void and	l_placed /= Void
+				then
+					create Result.make (l_line_items.name, l_currency, l_status, l_customer)
+					Result.set_placed (l_placed)
+				end
+			end
+		end
+
+	to_json (obj: detachable ANY; ctx: JSON_SERIALIZER_CONTEXT): JSON_VALUE
+		local
+			jo: JSON_OBJECT
+		do
+			if attached {ORDER} obj as o then
+				create jo.make
+				jo.put_integer (o.id, id_key)
+				jo.put_string (o.currency, currency_key)
+				jo.put_string (o.status, status_key)
+				jo.put_string (o.placed, placed_key)
+				jo.put (ctx.to_json (o.customer, create {JSON_CUSTOMER_CONVERTER}), customer_key)
+				jo.put (ctx.to_json (o.line_items, create {JSON_LINE_ITEM_CONVERTER}), line_items_key)
+				Result := jo
+			else
+				create {JSON_NULL} Result
+			end
+		end
+
+feature {NONE} -- Implementation
+
+	id_key: JSON_STRING
+		once
+			create Result.make_from_string ("id")
+		end
+
+	name_key: JSON_STRING
+		once
+			create Result.make_from_string ("name")
+		end
+
+	currency_key: JSON_STRING
+		once
+			create Result.make_from_string ("currency")
+		end
+
+	status_key: JSON_STRING
+		once
+			create Result.make_from_string ("status")
+		end
+
+	placed_key: JSON_STRING
+		once
+			create Result.make_from_string ("placed")
+		end
+
+	customer_key: JSON_STRING
+		once
+			create Result.make_from_string ("customer")
+		end
+
+	line_items_key: JSON_STRING
+		once
+			create Result.make_from_string ("line_items")
+		end
+
+end
diff --git a/test/hal_test_suite.e b/test/hal_test_suite.e
index 4766762..51e0457 100644
--- a/test/hal_test_suite.e
+++ b/test/hal_test_suite.e
@@ -3,22 +3,17 @@ note
 		Eiffel tests that can be executed by testing tool.
 	]"
 	author: "EiffelStudio test wizard"
-	date: "$Date$"
-	revision: "$Revision$"
+	date: "$Date: 2017-06-20 18:10:43 +0200 (mar., 20 juin 2017) $"
+	revision: "$Revision: 100533 $"
 	testing: "type/manual"
 
 class
 	HAL_TEST_SUITE
 
 inherit
-	SHARED_EJSON
-			rename default_create as default_create_ejson
-		end
 	EQA_TEST_SET
 		redefine
 			on_prepare
-		select
-			default_create
 		end
 
 feature {NONE} -- Events
@@ -48,9 +43,7 @@ feature -- Test routines
 			l_res : detachable HAL_RESOURCE
 		do
 			l_res := json_to_hal ("min_hal_document.json")
-			if attached l_res as l_r then
-				assert("Is Valid Hal document", True)
-			end
+			assert("Is Valid Hal document", l_res /= Void)
 		end
 
 
@@ -62,7 +55,7 @@ feature -- Test routines
 			l_res := json_to_hal ("min_hal.json")
 			assert("Not Void", l_res /= Void)
 			if attached l_res as l_r then
-				assert("Is Valid Resource", l_r.is_valid_resource = True)
+				assert("Is Valid Resource", l_r.is_valid_resource)
 			end
 		end
 
@@ -75,7 +68,7 @@ feature -- Test routines
 			l_res := json_to_hal ("empty.json")
 			assert("Not Void", l_res /= Void)
 			if attached l_res as l_r then
-				assert("Is Valid Resource", l_r.is_valid_resource = True)
+				assert("Is Valid Resource", l_r.is_valid_resource)
 			end
 		end
 
@@ -87,7 +80,7 @@ feature -- Test routines
 			l_res := json_to_hal ("min_hal.json")
 			assert("Not Void", l_res /= Void)
 			if attached l_res as ll_res then
-				if attached{HAL_LINK} ll_res.self as l_link then
+				if attached {HAL_LINK} ll_res.self as l_link then
 					assert ("Rel attribute is self", l_link.rel ~ "self" )
 					assert ("Has 1 element", l_link.attributes.count = 1 )
 					assert ("Has href",l_link.attributes.at (1).href ~ "http://example.com/")
@@ -119,18 +112,18 @@ feature -- Test routines
 
 	test_links_key
 		local
-			l_res : detachable HAL_RESOURCE
-			l_arr : ARRAY[STRING]
+			l_res: detachable HAL_RESOURCE
+			l_arr: ARRAY [READABLE_STRING_GENERAL]
 		do
 			l_res := json_to_hal ("hal_example.json")
-			assert("Not Void", l_res /= Void)
-			if attached{HAL_RESOURCE} l_res as ll_res then
-				l_arr := ll_res.links_keys
+			assert ("Not Void", l_res /= Void)
+			if l_res /= Void then
+				l_arr := l_res.links_keys
 				l_arr.compare_objects
 				assert ("Has three elements", l_arr.count = 3 )
-				assert ("Has element self", l_arr.has ("self") = True)
-				assert ("Has element next", l_arr.has ("next") = True)
-				assert ("Has element searcg", l_arr.has ("search") = True)
+				assert ("Has element self", l_arr.has ("self"))
+				assert ("Has element next", l_arr.has ("next"))
+				assert ("Has element searcg", l_arr.has ("search"))
 			end
 		end
 
@@ -141,12 +134,12 @@ feature -- Test routines
 		do
 			l_res := json_to_hal ("hal_example.json")
 			assert("Not Void", l_res /= Void)
-			if attached{HAL_RESOURCE} l_res as ll_res then
-				assert ("Expected Void",ll_res.links_by_key ("keynotexist") = Void)
-				if attached {HAL_LINK} ll_res.links_by_key ("next") as ll_link then
-					assert ("Expected rel : next", ll_link.rel ~ "next")
-					assert ("Expected shared links 1", ll_link.attributes.count = 1)
-					assert ("Expected Href value", ll_link.attributes.at (1).href ~ "/orders?page=2" )
+			if l_res /= Void then
+				assert ("Expected Void", l_res.links_by_key ("keynotexist") = Void)
+				if attached {HAL_LINK} l_res.links_by_key ("next") as l_link then
+					assert ("Expected rel : next", l_link.rel ~ "next")
+					assert ("Expected shared links 1", l_link.attributes.count = 1)
+					assert ("Expected Href value", l_link.attributes.first.href ~ "/orders?page=2" )
 				end
 			end
 		end
@@ -184,8 +177,6 @@ feature -- Test routines
 			end
 		end
 
-
-
 	test_fields_keys
 		local
 			l_res : detachable HAL_RESOURCE
@@ -202,8 +193,6 @@ feature -- Test routines
 			end
 		end
 
-
-
 	test_fields_by_key
 		local
 			l_res : detachable HAL_RESOURCE
@@ -220,7 +209,6 @@ feature -- Test routines
 			end
 		end
 
-
 	test_link_template
 		local
 				l_res : detachable HAL_RESOURCE
@@ -238,30 +226,27 @@ feature -- Test routines
 			end
 		end
 
-
-
-
 feature {NONE} -- Implementation
+
 	hal_to_json ( a_res : HAL_RESOURCE) : detachable JSON_VALUE
 		local
-				hal: JSON_HAL_RESOURCE_CONVERTER
+			conv: JSON_HAL_RESOURCE_CONVERTER
 		do
-				create hal.make
-				json.add_converter (hal)
-				Result := json.value (a_res)
+			create conv.make
+			Result := conv.to_json (a_res)
 		end
 
 	json_to_hal (fn : STRING) : detachable HAL_RESOURCE
 		local
-			parse_json: like new_json_parser
-			hal: JSON_HAL_RESOURCE_CONVERTER
+			jp: like new_json_parser
+			conv: JSON_HAL_RESOURCE_CONVERTER
 		do
-			create hal.make
-			json.add_converter (hal)
 			if attached json_file_from (fn) as json_file then
-				parse_json := new_json_parser (json_file)
-				if attached parse_json.parse_json as jv then
-					if attached {HAL_RESOURCE} json.object (jv, "HAL_RESOURCE") as l_hal then
+				jp := new_json_parser (json_file)
+				jp.parse_content
+				if attached jp.parsed_json_value as jv then
+					create conv.make
+					if attached {HAL_RESOURCE} conv.from_json (jv) as l_hal then
 						Result := l_hal
 					end
 				end
@@ -282,7 +267,7 @@ feature {NONE} -- Implementation
 
 	new_json_parser (a_string: STRING): JSON_PARSER
 		do
-			create Result.make_parser (a_string)
+			create Result.make_with_string (a_string)
 		end
 
 	json_value_from_file (json_file: STRING): detachable JSON_VALUE
@@ -290,15 +275,16 @@ feature {NONE} -- Implementation
 			p: like new_json_parser
 		do
 			p := new_json_parser (json_file)
-			Result := p.parse_json
+			p.parse_content
 			check json_is_parsed: p.is_parsed end
+			Result := p.parsed_json_value
 		end
 
-	test_dir: STRING
+	test_dir: STRING_32
 		local
 			i: INTEGER
 		do
-			Result := (create {EXECUTION_ENVIRONMENT}).current_working_directory
+			Result := (create {EXECUTION_ENVIRONMENT}).current_working_path.name
 			Result.append_character ((create {OPERATING_ENVIRONMENT}).directory_separator)
 				-- The should looks like
 				-- ..json\test\autotest\test_suite\EIFGENs\test_suite\Testing\execution\TEST_JSON_SUITE.test_json_fail1\..\..\..\..\..\fail1.json
diff --git a/test/model/customer.e b/test/model/customer.e
index 2609b45..3781157 100644
--- a/test/model/customer.e
+++ b/test/model/customer.e
@@ -1,29 +1,31 @@
 note
 	description: "Summary description for {CUSTOMER}."
 	author: ""
-	date: "$Date$"
-	revision: "$Revision$"
+	date: "$Date: 2017-06-20 16:23:13 +0200 (mar., 20 juin 2017) $"
+	revision: "$Revision: 100528 $"
 
 class
 	CUSTOMER
 create
 	make
 feature {NONE} -- Initialization
-	make (a_name : STRING; an_email: STRING)
+
+	make (a_name : READABLE_STRING_GENERAL; an_email: STRING)
 		do
 			set_name (a_name)
 			set_email (an_email)
 		end
 
 feature -- Acceess
-	name : STRING
+
+	name : STRING_32
 	email : STRING
 
 feature -- Element change	
 
-	set_name ( a_name : STRING)
+	set_name ( a_name : READABLE_STRING_GENERAL)
 		do
-			name := a_name
+			name := a_name.as_string_32
 		end
 
 	set_email (an_email : STRING)
diff --git a/test/model/item.e b/test/model/item.e
index a90204e..d83140e 100644
--- a/test/model/item.e
+++ b/test/model/item.e
@@ -1,14 +1,20 @@
 note
 	description: "Summary description for {ITEM}."
 	author: ""
-	date: "$Date$"
-	revision: "$Revision$"
+	date: "$Date: 2017-06-20 16:23:13 +0200 (mar., 20 juin 2017) $"
+	revision: "$Revision: 100528 $"
 
 class
 	ITEM
+
+inherit
+	DEBUG_OUTPUT
+
 create
 	make
+
 feature {NONE} -- Initialization
+
 	make (an_id : STRING; a_quantity : NATURAL; a_price : REAL )
 		do
 			set_id (an_id)
@@ -16,12 +22,24 @@ feature {NONE} -- Initialization
 			set_price (a_price)
 		end
 
+feature -- Status report
+
+	debug_output: STRING_32
+		do
+			create Result.make_empty
+			Result.append_string_general (id)
+		end
+
 feature -- Access
+
 	id : STRING
+
 	quantity : NATURAL
+
 	price : REAL
 
 feature -- Element Change
+
 	set_id (an_id : STRING)
 		do
 			id := an_id
diff --git a/test/model/line_item.e b/test/model/line_item.e
index 21f663e..5c7710d 100644
--- a/test/model/line_item.e
+++ b/test/model/line_item.e
@@ -1,8 +1,8 @@
 note
 	description: "Summary description for {LINE_ITEM}."
 	author: ""
-	date: "$Date$"
-	revision: "$Revision$"
+	date: "$Date: 2017-06-20 16:23:13 +0200 (mar., 20 juin 2017) $"
+	revision: "$Revision: 100528 $"
 
 class
 	LINE_ITEM
@@ -24,18 +24,14 @@ feature -- Access
 
    items: LIST [ITEM]
         do
-            from
-                create {LINKED_LIST [ITEM]} Result.make
-				item_index.start
-            until
-                item_index.after
+			create {ARRAYED_LIST [ITEM]} Result.make (item_index.count)
+			across
+				item_index as ic
             loop
-                Result.append (item_index.item_for_iteration)
-                item_index.forth
+                Result.append (ic.item)
             end
         end
 
-
 feature -- Status setting
 
     set_name (a_name: STRING_32)
@@ -45,35 +41,27 @@ feature -- Status setting
 
     add_item (an_item: ITEM)
         local
-            l: detachable LIST [ITEM]
+            lst: detachable LIST [ITEM]
         do
-            if item_index.has (an_item.id) then
-                l := item_index.at ( an_item.id )
-            else
-                create {LINKED_LIST [ITEM]} l.make
-                item_index.put (l, an_item.id)
-            end
-            if attached l as la then
-           	 	la.force (an_item)
+            lst := item_index.item (an_item.id)
+            if lst = Void then
+                create {ARRAYED_LIST [ITEM]} lst.make (1)
+                item_index.force (lst, an_item.id)
             end
-
+			lst.force (an_item)
         end
 
-	add_items (item_list: like items)
+	add_items (lst: like items)
         do
-            from
-                item_list.start
-            until
-                item_list.after
+            across
+                lst as ic
             loop
-                add_item (item_list.item)
-                item_list.forth
+                add_item (ic.item)
             end
         end
 
-
 feature {NONE} -- Implementation
 
-    item_index: HASH_TABLE [LIST [ITEM], STRING_32]
+    item_index: STRING_TABLE [LIST [ITEM]]
 
 end -- class LINE_ITEM
diff --git a/test/model/order.e b/test/model/order.e
index 419f12c..aa9ff69 100644
--- a/test/model/order.e
+++ b/test/model/order.e
@@ -1,8 +1,8 @@
 note
 	description: "Summary description for {ORDER}."
 	author: ""
-	date: "$Date$"
-	revision: "$Revision$"
+	date: "$Date: 2015-09-28 20:08:40 +0200 (lun., 28 sept. 2015) $"
+	revision: "$Revision: 97942 $"
 
 class
 	ORDER
diff --git a/test/model/order_repository.e b/test/model/order_repository.e
index 073b279..5e58315 100644
--- a/test/model/order_repository.e
+++ b/test/model/order_repository.e
@@ -1,31 +1,39 @@
 note
 	description: "Summary description for {ORDER_REPOSITORY}."
 	author: ""
-	date: "$Date$"
-	revision: "$Revision$"
+	date: "$Date: 2017-06-20 18:10:43 +0200 (mar., 20 juin 2017) $"
+	revision: "$Revision: 100533 $"
 
 class
 	ORDER_REPOSITORY
+
 create
 	make
-feature
-    make
-    	do
+
+feature {NONE} -- Initialization
+
+	make
+		do
 			create repo.make (10)
 			current_id := 0
 			next_id := 1
-    	end
- feature  -- Access
- 	current_id : INTEGER
- 	next_id : INTEGER
-
-    save ( a_order : ORDER)
-    	do
-    		repo.force (a_order, next_id)
-    		current_id := next_id
-    		next_id := next_id + 1
-    	end
+		end
+
+feature -- Access
+
+	current_id: INTEGER
+
+	next_id: INTEGER
+
+	save (a_order: ORDER)
+		do
+			repo.force (a_order, next_id)
+			current_id := next_id
+			next_id := next_id + 1
+		end
 
 feature {NONE} -- implementation
-	repo: HASH_TABLE[ORDER,INTEGER]
+
+	repo: HASH_TABLE [ORDER, INTEGER]
+
 end
diff --git a/test/model/shared_order_repository.e b/test/model/shared_order_repository.e
index 60b0baa..b229479 100644
--- a/test/model/shared_order_repository.e
+++ b/test/model/shared_order_repository.e
@@ -1,8 +1,8 @@
 note
 	description: "Summary description for {SHARED_ORDER_REPOSITORY}."
 	author: ""
-	date: "$Date$"
-	revision: "$Revision$"
+	date: "$Date: 2015-09-28 20:08:40 +0200 (lun., 28 sept. 2015) $"
+	revision: "$Revision: 97942 $"
 
 deferred class
 	SHARED_ORDER_REPOSITORY
diff --git a/test/test.rc b/test/test.rc
deleted file mode 100644
index b0ec159..0000000
--- a/test/test.rc
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <windows.h>
-
-STRINGTABLE
-BEGIN
-	1 "This Program was made using EiffelStudio using Visual Studio C++"
-END

From 8d4e3063df9cf6e1c67a16262776e36a17906ea9 Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Thu, 20 Jul 2017 10:25:17 -0300
Subject: [PATCH 03/47] Update HAL library Testing Travis CI

---
 .travis.yml                  | 5 +++++
 library/hal_link_attribute.e | 2 +-
 test/application.e           | 8 ++++----
 3 files changed, 10 insertions(+), 5 deletions(-)
 create mode 100644 .travis.yml

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..d1bcef6
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,5 @@
+language eiffel
+before_install:
+ - sudo add-apt-repository ppa:eiffelstudio-team/ppa 
+ - sudo apt-get update 
+ - sudo apt-get install eiffelstudio
\ No newline at end of file
diff --git a/library/hal_link_attribute.e b/library/hal_link_attribute.e
index f500801..2ba4fb1 100644
--- a/library/hal_link_attribute.e
+++ b/library/hal_link_attribute.e
@@ -128,7 +128,7 @@ feature -- Element change
 		do
 			create {STRING_32} title.make_from_string_general (a_title)
 		ensure
-			assigned: title = a_title
+			assigned: attached title as l_title and then l_title.is_case_insensitive_equal_general (a_title)
 		end
 
 	set_hreflang (a_hreflang: STRING)
diff --git a/test/application.e b/test/application.e
index 31a9946..49a68ad 100644
--- a/test/application.e
+++ b/test/application.e
@@ -57,10 +57,10 @@ feature {NONE} -- Initialization
 			if attached conv.to_json (l_res) as j then
 				print (j.representation)
 
-				if attached conv.from_json (j) as hal then
-					print (hal)
-					print (friendly_output (hal))
-				end
+--				if attached conv.from_json (j) as hal then
+--					print (hal)
+--					print (friendly_output (hal))
+--				end
 			end
 		end
 

From f8693bac3f9590309c9ad1304f02481c24e61a80 Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Thu, 20 Jul 2017 12:31:30 -0300
Subject: [PATCH 04/47] Updated Travis CI

---
 .travis.yml | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index d1bcef6..875d0c1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,19 @@
-language eiffel
-before_install:
- - sudo add-apt-repository ppa:eiffelstudio-team/ppa 
- - sudo apt-get update 
- - sudo apt-get install eiffelstudio
\ No newline at end of file
+language: eiffel
+before_script:
+  - cd ..
+  - wget https://ftp.eiffel.com/pub/beta/nightly/Eiffel_17.11_gpl_100608-linux-x86-64.tar.bz2  
+  - tar -xvf Eiffel_17.11_gpl_100608-linux-x86-64.tar.bz2
+  - export ISE_EIFFEL=$PWD/Eiffel_17.11
+  - export ISE_PLATFORM=linux-x86-64
+  - export PATH=$PATH:$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
+  - export PATH=$PATH:$ISE_EIFFEL/tools/spec/$ISE_PLATFORM/bin
+  - cd HAL
+
+# safelist
+branches:
+  only:
+  - hal_issue
+
+
+script: compile_all -ecb -melt -list_failures -clean -options dotnet=false
+

From d87482b6f8b6a634a17cde619a9b68578a5d980f Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Fri, 21 Jul 2017 10:32:40 -0300
Subject: [PATCH 05/47] Updated travis

---
 .travis.yml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 875d0c1..d2d0661 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,6 @@
 language: eiffel
 before_script:
+  - current_dir=$(pwd)
   - cd ..
   - wget https://ftp.eiffel.com/pub/beta/nightly/Eiffel_17.11_gpl_100608-linux-x86-64.tar.bz2  
   - tar -xvf Eiffel_17.11_gpl_100608-linux-x86-64.tar.bz2
@@ -7,12 +8,12 @@ before_script:
   - export ISE_PLATFORM=linux-x86-64
   - export PATH=$PATH:$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
   - export PATH=$PATH:$ISE_EIFFEL/tools/spec/$ISE_PLATFORM/bin
-  - cd HAL
+  - cd current_dir
 
 # safelist
 branches:
   only:
-  - hal_issue
+  - master
 
 
 script: compile_all -ecb -melt -list_failures -clean -options dotnet=false

From b840983cd7a432791286d2b37e99847e2b96a3e5 Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Fri, 21 Jul 2017 10:35:09 -0300
Subject: [PATCH 06/47] Update

---
 .travis.yml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index d2d0661..5decbc4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -15,6 +15,5 @@ branches:
   only:
   - master
 
-
 script: compile_all -ecb -melt -list_failures -clean -options dotnet=false
 

From 83f0cbd0dc65d0c00890da214b7048edce1b90c0 Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Fri, 21 Jul 2017 10:38:51 -0300
Subject: [PATCH 07/47] Updated

---
 .travis.yml | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 .travis.yml

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..5decbc4
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,19 @@
+language: eiffel
+before_script:
+  - current_dir=$(pwd)
+  - cd ..
+  - wget https://ftp.eiffel.com/pub/beta/nightly/Eiffel_17.11_gpl_100608-linux-x86-64.tar.bz2  
+  - tar -xvf Eiffel_17.11_gpl_100608-linux-x86-64.tar.bz2
+  - export ISE_EIFFEL=$PWD/Eiffel_17.11
+  - export ISE_PLATFORM=linux-x86-64
+  - export PATH=$PATH:$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
+  - export PATH=$PATH:$ISE_EIFFEL/tools/spec/$ISE_PLATFORM/bin
+  - cd current_dir
+
+# safelist
+branches:
+  only:
+  - master
+
+script: compile_all -ecb -melt -list_failures -clean -options dotnet=false
+

From 425c54524aad6ca99597b8a93c2da922301bac16 Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Fri, 21 Jul 2017 10:43:41 -0300
Subject: [PATCH 08/47] Updated

---
 .travis.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 5decbc4..3396eba 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,7 @@
 language: eiffel
 before_script:
-  - current_dir=$(pwd)
+  - set current_dir=$(pwd)
+  - echo current_dir
   - cd ..
   - wget https://ftp.eiffel.com/pub/beta/nightly/Eiffel_17.11_gpl_100608-linux-x86-64.tar.bz2  
   - tar -xvf Eiffel_17.11_gpl_100608-linux-x86-64.tar.bz2

From aa2167ea968de364219e4a67eb98ced62e854a10 Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Fri, 21 Jul 2017 10:48:48 -0300
Subject: [PATCH 09/47] Update travis CI 2

---
 .travis.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 3396eba..6cb4545 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,6 @@
 language: eiffel
 before_script:
-  - set current_dir=$(pwd)
+  - export current_dir=$(pwd)
   - echo current_dir
   - cd ..
   - wget https://ftp.eiffel.com/pub/beta/nightly/Eiffel_17.11_gpl_100608-linux-x86-64.tar.bz2  
@@ -9,7 +9,7 @@ before_script:
   - export ISE_PLATFORM=linux-x86-64
   - export PATH=$PATH:$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
   - export PATH=$PATH:$ISE_EIFFEL/tools/spec/$ISE_PLATFORM/bin
-  - cd current_dir
+  - cd $current_dir
 
 # safelist
 branches:

From 9839f1c186d5450224a6b1396fcb579773195d81 Mon Sep 17 00:00:00 2001
From: Javier Velilla <javier.hector@gmail.com>
Date: Mon, 24 Jul 2017 11:10:42 -0300
Subject: [PATCH 10/47] Update README

---
 README | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/README b/README
index f39397d..5a6f25f 100644
--- a/README
+++ b/README
@@ -1,5 +1,8 @@
 Eiffel HAL is a library to work with  http://stateless.co/hal_specification.html#json
 
+ Master: [![Build Status]](https://travis-ci.org/jvelilla/HAL.svg?branch=master)
+
+
 HAL is used for exposing RESTful hypermedia APIs. Right now the current implementation only support 
 JSON_HAL
 

From 2becd795418b690bb38f8e5a15b804cb5cffbad5 Mon Sep 17 00:00:00 2001
From: Javier Velilla <javier.hector@gmail.com>
Date: Mon, 24 Jul 2017 11:15:16 -0300
Subject: [PATCH 11/47] Update README

---
 README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README b/README
index 5a6f25f..8246ea6 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
 Eiffel HAL is a library to work with  http://stateless.co/hal_specification.html#json
 
- Master: [![Build Status]](https://travis-ci.org/jvelilla/HAL.svg?branch=master)
+ Master: [![Build Status] (https://travis-ci.org/jvelilla/HAL.svg?branch=hal_issue)](https://travis-ci.org/jvelilla/HAL.svg?branch=master)
 
 
 HAL is used for exposing RESTful hypermedia APIs. Right now the current implementation only support 

From 3550175f4fb427f223b33cb5cfc2d18f2e90bcb2 Mon Sep 17 00:00:00 2001
From: Javier Velilla <javier.hector@gmail.com>
Date: Mon, 24 Jul 2017 11:16:47 -0300
Subject: [PATCH 12/47] Update README

---
 README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README b/README
index 8246ea6..a4789a6 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
 Eiffel HAL is a library to work with  http://stateless.co/hal_specification.html#json
 
- Master: [![Build Status] (https://travis-ci.org/jvelilla/HAL.svg?branch=hal_issue)](https://travis-ci.org/jvelilla/HAL.svg?branch=master)
+ Master: [![Build Status](https://travis-ci.org/jvelilla/HAL.svg?branch=hal_issue)]
 
 
 HAL is used for exposing RESTful hypermedia APIs. Right now the current implementation only support 

From 605f514da37cef9180f57da0303834262afdcd61 Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Mon, 24 Jul 2017 12:27:33 -0300
Subject: [PATCH 13/47] Updated Readme file to show travis ci status

---
 README => README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename README => README.md (72%)

diff --git a/README b/README.md
similarity index 72%
rename from README
rename to README.md
index a4789a6..7802307 100644
--- a/README
+++ b/README.md
@@ -1,6 +1,6 @@
 Eiffel HAL is a library to work with  http://stateless.co/hal_specification.html#json
 
- Master: [![Build Status](https://travis-ci.org/jvelilla/HAL.svg?branch=hal_issue)]
+Master: [![Build Status](https://travis-ci.org/jvelilla/HAL.svg?branch=hal_issue)](https://travis-ci.org/jvelilla/HAL)
 
 
 HAL is used for exposing RESTful hypermedia APIs. Right now the current implementation only support 

From cadda834e4557b39807a23efdc3c8eb91cb6a22c Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Tue, 1 Aug 2017 16:58:15 -0300
Subject: [PATCH 14/47] Added appveyor CI

---
 .appveyor.yml | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 .appveyor.yml

diff --git a/.appveyor.yml b/.appveyor.yml
new file mode 100644
index 0000000..7f2daff
--- /dev/null
+++ b/.appveyor.yml
@@ -0,0 +1,52 @@
+# Bitprim
+#
+# Copyright (c) 2017 Bitprim developers (see AUTHORS)
+
+shallow_clone: true
+
+os:
+  - Visual Studio 2017
+
+build:
+  verbosity: detailed
+
+configuration:
+  - Release
+
+branches:
+  only:
+    - master
+
+install:
+  ############################################################################
+  # Install EiffelStudio 
+  ############################################################################
+  - mkdir C:\eiffel
+  - cd C:\eiffel
+
+  - set EIFFELSTUDIO_URL="https://ftp.eiffel.com/pub/beta/nightly/Eiffel_17.11_gpl_100607-win64.7z"
+  - appveyor DownloadFile %EIFFELSTUDIO_URL% -FileName eiffel_studio.zip
+  - 7z x eiffel_studio.zip -oC:\eiffel\ > nul
+  - set ISE_C_COMPILER=msc_vc140
+  - set ISE_PLATFORM=win64
+  - set ISE_EIFFEL=C:\eiffel\Eiffel_17.11 
+  - set PATH=%ISE_EIFFEL%/tools/spec/%ISE_PLATFORM%/bin;%PATH%
+  - set PATH=%ISE_EIFFEL%tools/spec/$ISE_PLATFORM/bin;%PATH%
+  - ec -version
+
+  ############################################################################
+  # Install EiffelStudio 
+  ############################################################################
+  - mkdir C:\projects
+
+
+ before_build:
+  - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" amd64
+
+
+build_script:
+  - cd C:\projects
+  - git clone https://github.com/jvelilla/HAL
+  - cd HAL
+  - compile_all -ecb -melt -list_failures -clean -options dotnet=false
+

From 411f04b73cca5e4f867512b9eebbb1e9a46e1ca3 Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Tue, 1 Aug 2017 17:02:52 -0300
Subject: [PATCH 15/47] Updated

---
 .appveyor.yml | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/.appveyor.yml b/.appveyor.yml
index 7f2daff..9dccafa 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -1,6 +1,3 @@
-# Bitprim
-#
-# Copyright (c) 2017 Bitprim developers (see AUTHORS)
 
 shallow_clone: true
 

From 06014594b421969be6aaa540d746134bb2632c36 Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Tue, 1 Aug 2017 17:07:53 -0300
Subject: [PATCH 16/47] Update

---
 .appveyor.yml | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/.appveyor.yml b/.appveyor.yml
index 9dccafa..faa976c 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -31,15 +31,9 @@ install:
   - set PATH=%ISE_EIFFEL%tools/spec/$ISE_PLATFORM/bin;%PATH%
   - ec -version
 
-  ############################################################################
-  # Install EiffelStudio 
-  ############################################################################
-  - mkdir C:\projects
-
-
  before_build:
   - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" amd64
-
+  - mkdir C:\projects
 
 build_script:
   - cd C:\projects

From b322a1e65e8bdde4ef826ba52d5dadef565f5d70 Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Tue, 1 Aug 2017 17:14:51 -0300
Subject: [PATCH 17/47] Updated

---
 .appveyor.yml | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/.appveyor.yml b/.appveyor.yml
index faa976c..7fdf6e7 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -2,7 +2,7 @@
 shallow_clone: true
 
 os:
-  - Visual Studio 2017
+  - Windows Server 2012
 
 build:
   verbosity: detailed
@@ -24,14 +24,14 @@ install:
   - set EIFFELSTUDIO_URL="https://ftp.eiffel.com/pub/beta/nightly/Eiffel_17.11_gpl_100607-win64.7z"
   - appveyor DownloadFile %EIFFELSTUDIO_URL% -FileName eiffel_studio.zip
   - 7z x eiffel_studio.zip -oC:\eiffel\ > nul
-  - set ISE_C_COMPILER=msc_vc140
-  - set ISE_PLATFORM=win64
-  - set ISE_EIFFEL=C:\eiffel\Eiffel_17.11 
-  - set PATH=%ISE_EIFFEL%/tools/spec/%ISE_PLATFORM%/bin;%PATH%
-  - set PATH=%ISE_EIFFEL%tools/spec/$ISE_PLATFORM/bin;%PATH%
+  - cmd: set ISE_C_COMPILER=msc_vc140
+  - cmd: set ISE_PLATFORM=win64
+  - cmd: set ISE_EIFFEL=C:\eiffel\Eiffel_17.11 
+  - cmd: set PATH=%ISE_EIFFEL%/tools/spec/%ISE_PLATFORM%/bin;%PATH%
+  - cmd: set PATH=%ISE_EIFFEL%tools/spec/$ISE_PLATFORM/bin;%PATH%
   - ec -version
 
- before_build:
+before_build:
   - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" amd64
   - mkdir C:\projects
 

From 69e879ee3f4f7f867559b2ba82498ded3fc6f764 Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Tue, 1 Aug 2017 17:22:23 -0300
Subject: [PATCH 18/47] Update

---
 .appveyor.yml | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/.appveyor.yml b/.appveyor.yml
index 7fdf6e7..4c4aef8 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -7,9 +7,6 @@ os:
 build:
   verbosity: detailed
 
-configuration:
-  - Release
-
 branches:
   only:
     - master
@@ -18,12 +15,12 @@ install:
   ############################################################################
   # Install EiffelStudio 
   ############################################################################
-  - mkdir C:\eiffel
-  - cd C:\eiffel
+  - mkdir C:\projects\eiffel
+  - cd C:\projects\eiffel
 
   - set EIFFELSTUDIO_URL="https://ftp.eiffel.com/pub/beta/nightly/Eiffel_17.11_gpl_100607-win64.7z"
   - appveyor DownloadFile %EIFFELSTUDIO_URL% -FileName eiffel_studio.zip
-  - 7z x eiffel_studio.zip -oC:\eiffel\ > nul
+  - 7z x eiffel_studio.zip -oC:\projects\eiffel\ > nul
   - cmd: set ISE_C_COMPILER=msc_vc140
   - cmd: set ISE_PLATFORM=win64
   - cmd: set ISE_EIFFEL=C:\eiffel\Eiffel_17.11 
@@ -33,7 +30,6 @@ install:
 
 before_build:
   - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" amd64
-  - mkdir C:\projects
 
 build_script:
   - cd C:\projects

From f4bab0a4a2b22727c6dc82840e2de8b7cc48aa57 Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Tue, 1 Aug 2017 17:26:15 -0300
Subject: [PATCH 19/47] Updated code

---
 .appveyor.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.appveyor.yml b/.appveyor.yml
index 4c4aef8..944b11f 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -23,7 +23,7 @@ install:
   - 7z x eiffel_studio.zip -oC:\projects\eiffel\ > nul
   - cmd: set ISE_C_COMPILER=msc_vc140
   - cmd: set ISE_PLATFORM=win64
-  - cmd: set ISE_EIFFEL=C:\eiffel\Eiffel_17.11 
+  - cmd: set ISE_EIFFEL=C:\projects\eiffel\Eiffel_17.11 
   - cmd: set PATH=%ISE_EIFFEL%/tools/spec/%ISE_PLATFORM%/bin;%PATH%
   - cmd: set PATH=%ISE_EIFFEL%tools/spec/$ISE_PLATFORM/bin;%PATH%
   - ec -version

From 16964537163fe40959995f070c4e47ffdedc0f05 Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Tue, 1 Aug 2017 17:31:23 -0300
Subject: [PATCH 20/47] updated

---
 .appveyor.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.appveyor.yml b/.appveyor.yml
index 944b11f..e3dc456 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -24,8 +24,8 @@ install:
   - cmd: set ISE_C_COMPILER=msc_vc140
   - cmd: set ISE_PLATFORM=win64
   - cmd: set ISE_EIFFEL=C:\projects\eiffel\Eiffel_17.11 
-  - cmd: set PATH=%ISE_EIFFEL%/tools/spec/%ISE_PLATFORM%/bin;%PATH%
-  - cmd: set PATH=%ISE_EIFFEL%tools/spec/$ISE_PLATFORM/bin;%PATH%
+  - cmd: set PATH=%ISE_EIFFEL%/studio/spec/%ISE_PLATFORM%/bin;%PATH%
+  - cmd: set PATH=%ISE_EIFFEL%tools/spec/%ISE_PLATFORM%/bin;%PATH%
   - ec -version
 
 before_build:

From 6644b0d90fb0ab06faa1fafc97168fcb678c9439 Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Tue, 1 Aug 2017 17:34:29 -0300
Subject: [PATCH 21/47] udpated

---
 .appveyor.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.appveyor.yml b/.appveyor.yml
index e3dc456..02aa28b 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -2,7 +2,7 @@
 shallow_clone: true
 
 os:
-  - Windows Server 2012
+  - Visual Studio 2017
 
 build:
   verbosity: detailed

From 69874a39b455a3366dfad9504ec45052c584873b Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Tue, 1 Aug 2017 17:40:09 -0300
Subject: [PATCH 22/47] Updated

---
 .appveyor.yml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/.appveyor.yml b/.appveyor.yml
index 02aa28b..a2671b9 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -24,9 +24,10 @@ install:
   - cmd: set ISE_C_COMPILER=msc_vc140
   - cmd: set ISE_PLATFORM=win64
   - cmd: set ISE_EIFFEL=C:\projects\eiffel\Eiffel_17.11 
-  - cmd: set PATH=%ISE_EIFFEL%/studio/spec/%ISE_PLATFORM%/bin;%PATH%
-  - cmd: set PATH=%ISE_EIFFEL%tools/spec/%ISE_PLATFORM%/bin;%PATH%
+  - cmd: set PATH=%PATH%;%ISE_EIFFEL%/studio/spec/%ISE_PLATFORM%/bin;
+  - cmd: set PATH=%PATH%;%ISE_EIFFEL%tools/spec/%ISE_PLATFORM%/bin;
   - ec -version
+  - compile_all -version
 
 before_build:
   - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" amd64

From cf22351afe8a0a8c6c1300d33acb116fe6b78ae2 Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Tue, 1 Aug 2017 17:43:00 -0300
Subject: [PATCH 23/47] fixed path

---
 .appveyor.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.appveyor.yml b/.appveyor.yml
index a2671b9..0b97644 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -25,7 +25,7 @@ install:
   - cmd: set ISE_PLATFORM=win64
   - cmd: set ISE_EIFFEL=C:\projects\eiffel\Eiffel_17.11 
   - cmd: set PATH=%PATH%;%ISE_EIFFEL%/studio/spec/%ISE_PLATFORM%/bin;
-  - cmd: set PATH=%PATH%;%ISE_EIFFEL%tools/spec/%ISE_PLATFORM%/bin;
+  - cmd: set PATH=%PATH%;%ISE_EIFFEL%/tools/spec/%ISE_PLATFORM%/bin;
   - ec -version
   - compile_all -version
 

From f8b6f87d25b10e99f60e847cc63c9cef0058d4bc Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Wed, 9 Aug 2017 17:02:22 -0300
Subject: [PATCH 24/47] Updated HAL serializer and deserializer to work with
 JSON_VALUES {number, string, bookean, null}. Updated hal resource to
 represent fields using their corresponding type an not string. Added a use
 case to test the new code.

---
 .../hal_resource_json_deserializer.e          | 10 ++++-
 .../converter/hal_resource_json_serializer.e  | 40 ++++++++++++++++++-
 library/hal_resource.e                        | 15 ++++---
 test/application.e                            | 33 +++++++++++----
 test/hal_example_type.json                    | 11 +++++
 5 files changed, 93 insertions(+), 16 deletions(-)
 create mode 100644 test/hal_example_type.json

diff --git a/library/converter/hal_resource_json_deserializer.e b/library/converter/hal_resource_json_deserializer.e
index 4d4a07a..14d4f46 100644
--- a/library/converter/hal_resource_json_deserializer.e
+++ b/library/converter/hal_resource_json_deserializer.e
@@ -32,9 +32,15 @@ feature -- Conversion
 						if attached {JSON_STRING} j_rep as js_rep then
 							Result.add_field (js.item, js_rep.unescaped_string_32)
 						elseif attached {JSON_NUMBER} j_rep as jn_rep then
-							Result.add_field (js.item, jn_rep.item)
+							if jn_rep.is_integer then
+								Result.add_field (js.item, jn_rep.integer_64_item)
+							elseif jn_rep.is_double then
+								Result.add_field (js.item, jn_rep.real_64_item)
+							else -- natural	
+								Result.add_field (js.item, jn_rep.natural_64_item)
+							end
 						elseif attached {JSON_BOOLEAN} j_rep as jb_rep then
-							Result.add_field (js.item, jb_rep.item.out)
+							Result.add_field (js.item, jb_rep.item)
 						elseif attached {JSON_NULL} j_rep as jnull then
 							Result.add_field (js.item, "null")
 						else
diff --git a/library/converter/hal_resource_json_serializer.e b/library/converter/hal_resource_json_serializer.e
index aad5366..2b2627e 100644
--- a/library/converter/hal_resource_json_serializer.e
+++ b/library/converter/hal_resource_json_serializer.e
@@ -29,7 +29,45 @@ feature -- Convertion
 					across
 						l_fields as ic
 					loop
-						jo.put_string (ic.item, ic.key)
+						if attached {BOOLEAN} ic.item as bool then
+							jo.put_boolean (bool, ic.key)
+						elseif attached {NUMERIC} ic.item as num then
+							if attached {INTEGER_64} num as i64 then
+								jo.put_integer (i64, ic.key)
+							elseif attached {INTEGER_32} num as i32 then
+								jo.put_integer (i32, ic.key)
+							elseif attached {INTEGER_16} num as i16 then
+								jo.put_integer (i16, ic.key)
+							elseif attached {INTEGER_8} num as i8 then
+								jo.put_integer (i8, ic.key)
+							elseif attached {NATURAL_64} num as n64 then
+								jo.put_natural (n64, ic.key)
+							elseif attached {NATURAL_32} num as n32 then
+								jo.put_natural (n32, ic.key)
+							elseif attached {NATURAL_16} num as n16 then
+								jo.put_natural (n16, ic.key)
+							elseif attached {NATURAL_8} num as n8 then
+								jo.put_natural (n8, ic.key)
+							elseif attached {REAL_64} num as r64 then
+								jo.put_real (r64, ic.key)
+							elseif attached {REAL_32} num as r32 then
+								jo.put_real (r32, ic.key)
+							else
+								jo.put_integer (num.out.to_integer_64, ic.key)
+							end
+						elseif attached {CHARACTER_8} ic.item as ch8 then
+							jo.put_string (ch8.out, ic.key) -- to be check
+						elseif attached {CHARACTER_32} ic.item as ch32 then
+							jo.put_string (ch32.out, ic.key) -- to be check
+						elseif attached {POINTER} ic.item as ptr then
+							jo.put_integer (ptr.to_integer_32, ic.key)
+						elseif attached {STRING_8} ic.item as str8 then
+							jo.put_string (str8, ic.key)
+						elseif attached {STRING_32} ic.item as str32 then
+							jo.put_string (str32, ic.key)
+						else
+							jo.put (create {JSON_NULL}, ic.key)
+						end
 					end
 				end
 				Result := jo
diff --git a/library/hal_resource.e b/library/hal_resource.e
index dd46530..d0c7680 100644
--- a/library/hal_resource.e
+++ b/library/hal_resource.e
@@ -143,8 +143,8 @@ feature -- Access
 			end
 		end
 
-	fields_by_key (a_key: READABLE_STRING_GENERAL): detachable READABLE_STRING_32
-			-- Return a string value, if key `a_key' exists
+	fields_by_key (a_key: READABLE_STRING_GENERAL): detachable ANY
+			-- Return a value, if key `a_key' exists
 			-- Void in othercase
 		do
 			if attached fields as l_fields then
@@ -152,6 +152,7 @@ feature -- Access
 			end
 		end
 
+
 feature -- Element Change
 
 	add_all_links (all_link: STRING_TABLE [HAL_LINK])
@@ -196,14 +197,14 @@ feature -- Element Change
 			add_link_with_key ("curies", create {HAL_LINK}.make_with_attribute ("curies", a_attribute))
 		end
 
-	add_fields (key: READABLE_STRING_GENERAL; value: READABLE_STRING_GENERAL)
+	add_fields (key: READABLE_STRING_GENERAL; value: ANY)
 		obsolete
 			"Use `add_field` [2017-06-20]"
 		do
 			add_field (key, value)
 		end
 
-	add_field (key: READABLE_STRING_GENERAL; value: READABLE_STRING_GENERAL)
+	add_field (key: READABLE_STRING_GENERAL; value: ANY)
 		local
 			l_fields: like fields
 		do
@@ -212,7 +213,7 @@ feature -- Element Change
 				create l_fields.make (1)
 				fields := l_fields
 			end
-			l_fields.force (value.to_string_32, key)
+			l_fields.force (value, key)
 		end
 
 	add_embedded_resource_with_key (key: READABLE_STRING_GENERAL; res: HAL_RESOURCE)
@@ -252,6 +253,7 @@ feature -- Status Report
 			Result := links.has_key ("self") or else links.is_empty
 		end
 
+
 feature {HAL_ACCESS} -- Implementation
 
 	links: STRING_TABLE [HAL_LINK]
@@ -260,7 +262,8 @@ feature {HAL_ACCESS} -- Implementation
 	embedded_resource: detachable STRING_TABLE [LIST [HAL_RESOURCE]]
 			-- expressing the embedded nature of a given part of the representation.
 
-	fields: detachable STRING_TABLE [READABLE_STRING_32]
+	fields: detachable STRING_TABLE [ANY]
 			-- Properties representing current state of Current resource.
 
+
 end
diff --git a/test/application.e b/test/application.e
index 49a68ad..d60c95d 100644
--- a/test/application.e
+++ b/test/application.e
@@ -18,12 +18,13 @@ feature {NONE} -- Initialization
 	make
 		do
 			create file_reader
---			test_json_min
---			test_json_hal
+			test_json_min
+			test_json_hal
 --			test_json_link
---			test_hal
+			test_hal
 			test_item_line_item
 			test_order
+			test_hal_types
 
 			example_from_hal_to_domain
 			test_build_hal_json
@@ -57,10 +58,10 @@ feature {NONE} -- Initialization
 			if attached conv.to_json (l_res) as j then
 				print (j.representation)
 
---				if attached conv.from_json (j) as hal then
---					print (hal)
---					print (friendly_output (hal))
---				end
+				if attached conv.from_json (j) as hal then
+					print (hal)
+					print (friendly_output (hal))
+				end
 			end
 		end
 
@@ -210,6 +211,24 @@ feature {NONE} -- Initialization
 			end
 		end
 
+	test_hal_types
+		local
+			conv: JSON_HAL_RESOURCE_CONVERTER
+		do
+			create conv.make
+			if attached json_file_from ("hal_example_type.json") as json_file then
+				if attached {JSON_OBJECT} json_value_from_file (json_file) as jo then
+					if attached {HAL_RESOURCE} conv.from_json (jo) as r then
+						print (r.out)
+						print ("%N")
+						if attached conv.to_json (r) as jv then
+							print (jv.representation)
+						end
+					end
+				end
+			end
+		end
+
 	test_json_hal
 			--
 		do
diff --git a/test/hal_example_type.json b/test/hal_example_type.json
new file mode 100644
index 0000000..b8099b6
--- /dev/null
+++ b/test/hal_example_type.json
@@ -0,0 +1,11 @@
+ {
+     "_links": {
+       "self": { "href": "/test" },
+       "next": { "href": "/test?page=2" },
+       "find": { "href": "/tes{?id}", "templated": true }
+     },
+     "id": 1,
+     "price": 20,
+     "name": "T-Shit",
+     "new": true 
+   }

From 671df3d0c60fb16203d58d81ad7df39e5e7f1026 Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Fri, 11 Aug 2017 10:59:32 -0300
Subject: [PATCH 25/47] Updated HAL_RESOURCE now we have a set of feature to
 add fields by type add_string_field, add_real_field, add_natural_field,
 add_boolean_field, etc. Updated HAL_RESOURCE_JSON_DESERIALIZER to use the new
 set of features. Updated Application use cases and added a new HAL json
 representation with nested objects.

---
 .../hal_resource_json_deserializer.e          | 16 ++--
 .../converter/hal_resource_json_serializer.e  |  1 +
 library/hal_resource.e                        | 79 ++++++++++++++++++-
 test/application.e                            | 46 ++++++++---
 test/exampleWithNestedObjects.json            | 35 ++++++++
 test/hal_test_suite.e                         |  4 +-
 6 files changed, 158 insertions(+), 23 deletions(-)
 create mode 100644 test/exampleWithNestedObjects.json

diff --git a/library/converter/hal_resource_json_deserializer.e b/library/converter/hal_resource_json_deserializer.e
index 14d4f46..85446a9 100644
--- a/library/converter/hal_resource_json_deserializer.e
+++ b/library/converter/hal_resource_json_deserializer.e
@@ -18,6 +18,7 @@ feature -- Conversion
 		local
 			l_list: LIST [HAL_RESOURCE]
 			js: JSON_STRING
+
 		do
 			if attached {JSON_OBJECT} a_json as j then
 				create Result.make
@@ -30,21 +31,22 @@ feature -- Conversion
 						attached j.item (js) as j_rep
 					then
 						if attached {JSON_STRING} j_rep as js_rep then
-							Result.add_field (js.item, js_rep.unescaped_string_32)
+							Result.add_string_field (js.item, js_rep.unescaped_string_32)
 						elseif attached {JSON_NUMBER} j_rep as jn_rep then
 							if jn_rep.is_integer then
-								Result.add_field (js.item, jn_rep.integer_64_item)
+								Result.add_integer_field (js.item, jn_rep.integer_64_item)
 							elseif jn_rep.is_double then
-								Result.add_field (js.item, jn_rep.real_64_item)
+								Result.add_real_field (js.item, jn_rep.real_64_item)
 							else -- natural	
-								Result.add_field (js.item, jn_rep.natural_64_item)
+								Result.add_natural_field (js.item, jn_rep.natural_64_item)
 							end
 						elseif attached {JSON_BOOLEAN} j_rep as jb_rep then
-							Result.add_field (js.item, jb_rep.item)
+							Result.add_boolean_field (js.item, jb_rep.item)
 						elseif attached {JSON_NULL} j_rep as jnull then
-							Result.add_field (js.item, "null")
+							Result.add_null_field (js.item)
 						else
-							Result.add_field (js.item, j_rep.representation)
+								-- !TODO check how to handle JSON_ARRAY and JSON_OBJECTS.
+							Result.add_string_field (js.item, j_rep.representation)
 						end
 					end
 				end
diff --git a/library/converter/hal_resource_json_serializer.e b/library/converter/hal_resource_json_serializer.e
index 2b2627e..6f28d2c 100644
--- a/library/converter/hal_resource_json_serializer.e
+++ b/library/converter/hal_resource_json_serializer.e
@@ -53,6 +53,7 @@ feature -- Convertion
 							elseif attached {REAL_32} num as r32 then
 								jo.put_real (r32, ic.key)
 							else
+								check is_basic_numeric_type: False end
 								jo.put_integer (num.out.to_integer_64, ic.key)
 							end
 						elseif attached {CHARACTER_8} ic.item as ch8 then
diff --git a/library/hal_resource.e b/library/hal_resource.e
index d0c7680..d622fa2 100644
--- a/library/hal_resource.e
+++ b/library/hal_resource.e
@@ -143,7 +143,7 @@ feature -- Access
 			end
 		end
 
-	fields_by_key (a_key: READABLE_STRING_GENERAL): detachable ANY
+	field_by_key (a_key: READABLE_STRING_GENERAL): detachable ANY
 			-- Return a value, if key `a_key' exists
 			-- Void in othercase
 		do
@@ -205,6 +205,46 @@ feature -- Element Change
 		end
 
 	add_field (key: READABLE_STRING_GENERAL; value: ANY)
+		obsolete
+				"[
+					Use `dd_string_field, add_integer_field, add_real_field, add_natural_field, add_boolean_field, add_null_field [2017-06-20]
+					]"
+		local
+			l_fields: like fields
+		do
+			l_fields := fields
+			if l_fields = Void then
+				create l_fields.make (1)
+				fields := l_fields
+			end
+			l_fields.force (value, key)
+		end
+
+	add_string_field (key: READABLE_STRING_GENERAL; value: READABLE_STRING_32)
+		local
+			l_fields: like fields
+		do
+			l_fields := fields
+			if l_fields = Void then
+				create l_fields.make (1)
+				fields := l_fields
+			end
+			l_fields.force (value, key)
+		end
+
+	add_integer_field (key: READABLE_STRING_GENERAL; value: INTEGER_64)
+		local
+			l_fields: like fields
+		do
+			l_fields := fields
+			if l_fields = Void then
+				create l_fields.make (1)
+				fields := l_fields
+			end
+			l_fields.force (value, key)
+		end
+
+	add_real_field (key: READABLE_STRING_GENERAL; value: REAL_64)
 		local
 			l_fields: like fields
 		do
@@ -216,6 +256,43 @@ feature -- Element Change
 			l_fields.force (value, key)
 		end
 
+	add_natural_field (key: READABLE_STRING_GENERAL; value: NATURAL_64)
+		local
+			l_fields: like fields
+		do
+			l_fields := fields
+			if l_fields = Void then
+				create l_fields.make (1)
+				fields := l_fields
+			end
+			l_fields.force (value, key)
+		end
+
+	add_boolean_field (key: READABLE_STRING_GENERAL; value: BOOLEAN)
+		local
+			l_fields: like fields
+		do
+			l_fields := fields
+			if l_fields = Void then
+				create l_fields.make (1)
+				fields := l_fields
+			end
+			l_fields.force (value, key)
+		end
+
+	add_null_field (key: READABLE_STRING_GENERAL)
+		local
+			l_fields: like fields
+		do
+			l_fields := fields
+			if l_fields = Void then
+				create l_fields.make (1)
+				fields := l_fields
+			end
+			l_fields.force ("null", key)
+		end
+
+
 	add_embedded_resource_with_key (key: READABLE_STRING_GENERAL; res: HAL_RESOURCE)
 		local
 			er: like embedded_resource
diff --git a/test/application.e b/test/application.e
index d60c95d..d188c39 100644
--- a/test/application.e
+++ b/test/application.e
@@ -18,16 +18,17 @@ feature {NONE} -- Initialization
 	make
 		do
 			create file_reader
-			test_json_min
-			test_json_hal
---			test_json_link
-			test_hal
-			test_item_line_item
-			test_order
-			test_hal_types
-
-			example_from_hal_to_domain
-			test_build_hal_json
+--			test_json_min
+--			test_json_hal
+----			test_json_link
+--			test_hal
+--			test_item_line_item
+--			test_order
+--			test_hal_types
+			test_example_with_nested_objects
+
+--			example_from_hal_to_domain
+--			test_build_hal_json
 		end
 
 	test_build_hal_json
@@ -101,19 +102,19 @@ feature {NONE} -- Initialization
 							loop
 								l_res:= l_r.item_for_iteration
 
-					            if attached {STRING} l_res.fields_by_key ("currency") as l_ucs then
+					            if attached {STRING} l_res.field_by_key ("currency") as l_ucs then
 					            	l_currency := l_ucs
 					            	print ("Currency:" + l_currency)
 					            	io.put_new_line
 					            end
 
-					            if attached {STRING} l_res.fields_by_key ("status") as l_ucs then
+					            if attached {STRING} l_res.field_by_key ("status") as l_ucs then
 					            	l_status := l_ucs
 									print ("Status:" + l_status )
 									io.put_new_line
 								end
 
-								if attached {STRING} l_res.fields_by_key ("placed") as l_ucs then
+								if attached {STRING} l_res.field_by_key ("placed") as l_ucs then
 					            	l_placed := l_ucs
 					            	print ("Placed:" + l_placed )
 					            	io.put_new_line
@@ -229,6 +230,25 @@ feature {NONE} -- Initialization
 			end
 		end
 
+	test_example_with_nested_objects
+		local
+			conv: JSON_HAL_RESOURCE_CONVERTER
+		do
+			create conv.make
+			if attached json_file_from ("exampleWithNestedObjects.json") as json_file then
+				if attached {JSON_OBJECT} json_value_from_file (json_file) as jo then
+					if attached {HAL_RESOURCE} conv.from_json (jo) as r then
+						print (r.out)
+						print ("%N")
+						if attached conv.to_json (r) as jv then
+							print (jv.representation)
+						end
+					end
+				end
+			end
+		end
+
+
 	test_json_hal
 			--
 		do
diff --git a/test/exampleWithNestedObjects.json b/test/exampleWithNestedObjects.json
new file mode 100644
index 0000000..8f911dc
--- /dev/null
+++ b/test/exampleWithNestedObjects.json
@@ -0,0 +1,35 @@
+{
+    "_links" : {
+        "curies" : [ {
+            "href" : "https://example.com/apidocs/ns/{rel}",
+            "name" : "ns",
+            "templated" : true
+        }, {
+            "href" : "https://example.com/apidocs/role/{rel}",
+            "name" : "role",
+            "templated" : true
+        } ],
+        "self" : {
+            "href" : "https://example.com/api/customer/123456"
+        },
+        "ns:parent" : {
+            "href" : "https://example.com/api/customer/1234",
+            "name" : "bob",
+            "title" : "The Parent",
+            "hreflang" : "en"
+        },
+        "ns:users" : {
+            "href" : "https://example.com/api/customer/123456?users"
+        }
+    },
+    "age" : 33,
+    "expired" : false,
+    "id" : 123456,
+    "name" : "Example Resource",
+    "optional" : true,
+    "child" : { "age" : 12, "expired" : false, "id" : 111111, "name" : "Example Resource 1","optional" : true  },
+    "children" : [
+        { "age" : 12, "expired" : false, "id" : 111111, "name" : "Example Resource 1","optional" : true  },
+        { "age" : 10, "expired" : false, "id" : 222222, "name" : "Example Resource 2","optional" : true  }
+    ]
+}
\ No newline at end of file
diff --git a/test/hal_test_suite.e b/test/hal_test_suite.e
index 51e0457..d58278a 100644
--- a/test/hal_test_suite.e
+++ b/test/hal_test_suite.e
@@ -200,10 +200,10 @@ feature -- Test routines
 			l_res := json_to_hal ("hal_multi_links.json")
 			assert("Not Void", l_res /= Void)
 			if attached {HAL_RESOURCE} l_res as ll_res then
-				if attached {STRING_32} ll_res.fields_by_key ("name") as l_str then
+				if attached {STRING_32} ll_res.field_by_key ("name") as l_str then
 					assert ("Expected Value: A product", l_str.is_equal ("A product"))
 				end
-				if attached {STRING_32} ll_res.fields_by_key ("weight") as l_str then
+				if attached {STRING_32} ll_res.field_by_key ("weight") as l_str then
 					assert ("Expected Value: A product", l_str.is_equal ("400"))
 				end
 			end

From a8495209b70d015cf083dc86712233db98ed16e5 Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Wed, 16 Aug 2017 11:32:13 -0300
Subject: [PATCH 26/47] Updated HAL library to handle HAL references fields.
 Updated HAL JSON DESERIALIZER to handle reference fields. Updated HAL JSON
 SERIALIZER, reusing JSON_REFLECTOR_SERIALIZER. Updated configuration files to
 use the latest schema version. Updated HAL RESOURCE to get and add fields by
 type, added field reference values array and object. Updated test APPLICATION
 with an example using nested objects.

---
 .appveyor.yml                                 |  40 ++++
 .../hal_resource_json_deserializer.e          | 117 ++++++++++-
 .../converter/hal_resource_json_serializer.e  |  63 +++---
 library/hal-safe.ecf                          |   5 +-
 library/hal.ecf                               |   6 +-
 library/hal_resource.e                        | 192 ++++++++++++++++++
 test/application.e                            |  42 +++-
 test/test_suite.ecf                           |  11 +-
 8 files changed, 416 insertions(+), 60 deletions(-)
 create mode 100644 .appveyor.yml

diff --git a/.appveyor.yml b/.appveyor.yml
new file mode 100644
index 0000000..0b97644
--- /dev/null
+++ b/.appveyor.yml
@@ -0,0 +1,40 @@
+
+shallow_clone: true
+
+os:
+  - Visual Studio 2017
+
+build:
+  verbosity: detailed
+
+branches:
+  only:
+    - master
+
+install:
+  ############################################################################
+  # Install EiffelStudio 
+  ############################################################################
+  - mkdir C:\projects\eiffel
+  - cd C:\projects\eiffel
+
+  - set EIFFELSTUDIO_URL="https://ftp.eiffel.com/pub/beta/nightly/Eiffel_17.11_gpl_100607-win64.7z"
+  - appveyor DownloadFile %EIFFELSTUDIO_URL% -FileName eiffel_studio.zip
+  - 7z x eiffel_studio.zip -oC:\projects\eiffel\ > nul
+  - cmd: set ISE_C_COMPILER=msc_vc140
+  - cmd: set ISE_PLATFORM=win64
+  - cmd: set ISE_EIFFEL=C:\projects\eiffel\Eiffel_17.11 
+  - cmd: set PATH=%PATH%;%ISE_EIFFEL%/studio/spec/%ISE_PLATFORM%/bin;
+  - cmd: set PATH=%PATH%;%ISE_EIFFEL%/tools/spec/%ISE_PLATFORM%/bin;
+  - ec -version
+  - compile_all -version
+
+before_build:
+  - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" amd64
+
+build_script:
+  - cd C:\projects
+  - git clone https://github.com/jvelilla/HAL
+  - cd HAL
+  - compile_all -ecb -melt -list_failures -clean -options dotnet=false
+
diff --git a/library/converter/hal_resource_json_deserializer.e b/library/converter/hal_resource_json_deserializer.e
index 85446a9..6bc079a 100644
--- a/library/converter/hal_resource_json_deserializer.e
+++ b/library/converter/hal_resource_json_deserializer.e
@@ -18,7 +18,10 @@ feature -- Conversion
 		local
 			l_list: LIST [HAL_RESOURCE]
 			js: JSON_STRING
-
+			l_any: detachable ANY
+			err: DEVELOPER_EXCEPTION
+			l_table: STRING_TABLE [ANY]
+			l_array: ARRAY [ANY]
 		do
 			if attached {JSON_OBJECT} a_json as j then
 				create Result.make
@@ -45,8 +48,20 @@ feature -- Conversion
 						elseif attached {JSON_NULL} j_rep as jnull then
 							Result.add_null_field (js.item)
 						else
-								-- !TODO check how to handle JSON_ARRAY and JSON_OBJECTS.
-							Result.add_string_field (js.item, j_rep.representation)
+								-- HAL reference fields: JSON_OBJECT or JSON_ARRAY
+							if attached {JSON_OBJECT} j_rep as j_object then
+								create l_table.make (1)
+								add_reference_field (j_object, l_table)
+								Result.add_object_field (js.item, l_table)
+							elseif attached {JSON_ARRAY} j_rep as j_array  then
+								create l_array.make_filled ({ANY}, 1, j_array.count)
+								add_reference_field (j_array, l_array)
+								Result.add_array_field (js.item, l_array)
+							else
+								-- Unexpected value
+								create err
+								err.set_description ("Unexpected JSON representation: [ " + j_rep.representation + " ]")
+							end
 						end
 					end
 				end
@@ -159,6 +174,102 @@ feature {NONE} -- Converter implementation
 			end
 		end
 
+	add_reference_field (a_object: JSON_VALUE; a_reference: ANY )
+			-- Add hal Reference fields
+			-- JSON_OBJECTS or JSON_ARRAYS.
+		local
+			js: JSON_STRING
+			l_table: STRING_TABLE [ANY]
+			l_array: ARRAY [ANY]
+			err: DEVELOPER_EXCEPTION
+			i: INTEGER
+		do
+			if
+				attached {JSON_OBJECT} a_object as j and then
+				attached {STRING_TABLE [ANY]} a_reference as a_table
+			then
+				across
+					j.current_keys as ic
+				loop
+					js := ic.item
+					if
+						attached j.item (js) as j_rep
+					then
+						if attached {JSON_STRING} j_rep as js_rep then
+							a_table.force (js_rep.unescaped_string_32, js.item)
+						elseif attached {JSON_NUMBER} j_rep as jn_rep then
+							if jn_rep.is_integer then
+								a_table.force (jn_rep.integer_64_item, js.item)
+							elseif jn_rep.is_double then
+								a_table.force (jn_rep.real_64_item, js.item)
+							else -- natural	
+								a_table.force (jn_rep.natural_64_item, js.item)
+							end
+						elseif attached {JSON_BOOLEAN} j_rep as jb_rep then
+							a_table.force (jb_rep.item, js.item)
+						elseif attached {JSON_NULL} j_rep as jnull then
+							a_table.force ("null",js.item)
+						else
+								-- JSON_OBJECT
+							if attached {JSON_OBJECT} j_rep as j_object then
+								create l_table.make (1)
+								add_reference_field (j_object, l_table)
+								a_table.force (l_table, js.item)
+								-- JSON_ARRAY
+							elseif attached {JSON_ARRAY} j_rep as j_array  then
+								create l_array.make_filled ({ANY}, 1, j_array.count)
+								add_reference_field (j_array, l_array)
+								a_table.force (l_array, js.item)
+							else
+								-- Unexpected value
+								create err
+								err.set_description ("Unexpected JSON representation: [ " + j_rep.representation + " ]")
+							end
+						end
+					end
+				end
+			elseif
+				attached {JSON_ARRAY} a_object as j_array and then
+				attached {ARRAY [ANY]} a_reference as a_array
+			then
+				i := 1
+				across j_array as ic  loop
+					if attached {JSON_STRING} ic.item as js_rep then
+						a_array.force (js_rep, i)
+					elseif attached {JSON_NUMBER} ic.item as jn_rep then
+						if jn_rep.is_integer then
+							a_array.force (jn_rep.integer_64_item, i)
+						elseif jn_rep.is_double then
+							a_array.force (jn_rep.real_64_item, i)
+						else -- natural	
+							a_array.force (jn_rep.natural_64_item, i)
+						end
+					elseif attached {JSON_BOOLEAN} ic.item as jb_rep then
+						a_array.force (jb_rep.item, i)
+					elseif attached {JSON_NULL} ic.item as jnull then
+						a_array.force ("null", i)
+					else
+							-- JSON_OBJECT
+						if attached {JSON_OBJECT} ic.item as j_object then
+							create l_table.make (1)
+							add_reference_field (ic.item, l_table)
+							a_array.force (l_table, i)
+							-- JSON_ARRAY
+						elseif attached {JSON_ARRAY} ic.item as j_arr  then
+							create l_array.make_filled ({ANY}, 1, j_array.count)
+							add_reference_field (j_array, l_array)
+							a_array.force (l_array, i)
+						else
+							-- Unexpected value
+							create err
+							err.set_description ("Unexpected JSON representation: [ " + ic.item.representation + " ]")
+						end
+					end
+					i := i + 1
+				end
+			end
+		end
+
 feature {NONE} -- Implementation: RESOURCE
 
 	links_key: JSON_STRING
diff --git a/library/converter/hal_resource_json_serializer.e b/library/converter/hal_resource_json_serializer.e
index 6f28d2c..f01a8ce 100644
--- a/library/converter/hal_resource_json_serializer.e
+++ b/library/converter/hal_resource_json_serializer.e
@@ -29,46 +29,7 @@ feature -- Convertion
 					across
 						l_fields as ic
 					loop
-						if attached {BOOLEAN} ic.item as bool then
-							jo.put_boolean (bool, ic.key)
-						elseif attached {NUMERIC} ic.item as num then
-							if attached {INTEGER_64} num as i64 then
-								jo.put_integer (i64, ic.key)
-							elseif attached {INTEGER_32} num as i32 then
-								jo.put_integer (i32, ic.key)
-							elseif attached {INTEGER_16} num as i16 then
-								jo.put_integer (i16, ic.key)
-							elseif attached {INTEGER_8} num as i8 then
-								jo.put_integer (i8, ic.key)
-							elseif attached {NATURAL_64} num as n64 then
-								jo.put_natural (n64, ic.key)
-							elseif attached {NATURAL_32} num as n32 then
-								jo.put_natural (n32, ic.key)
-							elseif attached {NATURAL_16} num as n16 then
-								jo.put_natural (n16, ic.key)
-							elseif attached {NATURAL_8} num as n8 then
-								jo.put_natural (n8, ic.key)
-							elseif attached {REAL_64} num as r64 then
-								jo.put_real (r64, ic.key)
-							elseif attached {REAL_32} num as r32 then
-								jo.put_real (r32, ic.key)
-							else
-								check is_basic_numeric_type: False end
-								jo.put_integer (num.out.to_integer_64, ic.key)
-							end
-						elseif attached {CHARACTER_8} ic.item as ch8 then
-							jo.put_string (ch8.out, ic.key) -- to be check
-						elseif attached {CHARACTER_32} ic.item as ch32 then
-							jo.put_string (ch32.out, ic.key) -- to be check
-						elseif attached {POINTER} ic.item as ptr then
-							jo.put_integer (ptr.to_integer_32, ic.key)
-						elseif attached {STRING_8} ic.item as str8 then
-							jo.put_string (str8, ic.key)
-						elseif attached {STRING_32} ic.item as str32 then
-							jo.put_string (str32, ic.key)
-						else
-							jo.put (create {JSON_NULL}, ic.key)
-						end
+						jo.put (to_json_value (ic.item), ic.key)
 					end
 				end
 				Result := jo
@@ -186,6 +147,28 @@ feature {NONE} -- Converter implementation
 
 		end
 
+	to_json_value (a_obj: ANY): JSON_VALUE
+			-- Convert an object `a_obj' to JSON_VALUE representation.
+		local
+			obj: ANY
+			conv_to: JSON_REFLECTOR_SERIALIZER
+			ctx: detachable JSON_SERIALIZER_CONTEXT
+			s: STRING
+		do
+			obj := a_obj
+
+				-- Auto serialization, handling table iterable as JSON Object, and iterable as ARRAY. Without typename.
+			create conv_to
+			create ctx
+			ctx.set_pretty_printing
+			ctx.set_is_type_name_included (False)
+			ctx.set_default_serializer (create {JSON_REFLECTOR_SERIALIZER})
+			ctx.register_serializer (create {TABLE_ITERABLE_JSON_SERIALIZER [detachable ANY, READABLE_STRING_GENERAL]}, {TABLE_ITERABLE [detachable ANY, READABLE_STRING_GENERAL]})
+			ctx.register_serializer (create {ITERABLE_JSON_SERIALIZER [detachable ANY]}, {ITERABLE [detachable ANY]})
+
+			Result := conv_to.to_json (obj, ctx)
+		end
+
 feature {NONE} -- Implementation: RESOURCE
 
 	links_key: JSON_STRING
diff --git a/library/hal-safe.ecf b/library/hal-safe.ecf
index e59d2e5..f632ea7 100644
--- a/library/hal-safe.ecf
+++ b/library/hal-safe.ecf
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-14-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-14-0 http://www.eiffel.com/developers/xml/configuration-1-14-0.xsd" name="hal" uuid="94C384A6-8CAD-48C2-B448-EFA81264AFFD" library_target="hal">
+<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-16-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-16-0 http://www.eiffel.com/developers/xml/configuration-1-16-0.xsd" name="hal" uuid="94C384A6-8CAD-48C2-B448-EFA81264AFFD" library_target="hal">
 	<target name="hal">
 		<root all_classes="true"/>
-		<option warning="true" full_class_checking="false" is_attached_by_default="true" void_safety="all" syntax="standard">
+		<option warning="true">
 			<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
 		</option>
+
 		<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
 		<library name="json" location="$ISE_LIBRARY\contrib\library\text\parser\json\library\json-safe.ecf"/>
 		<library name="uri_template" location="$ISE_LIBRARY\contrib\library\text\parser\uri_template\uri_template-safe.ecf"/>
diff --git a/library/hal.ecf b/library/hal.ecf
index e55331f..c2ea226 100644
--- a/library/hal.ecf
+++ b/library/hal.ecf
@@ -1,10 +1,12 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-9-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-9-0 http://www.eiffel.com/developers/xml/configuration-1-9-0.xsd" name="hal" uuid="94C384A6-8CAD-48C2-B448-EFA81264AFFD" library_target="hal">
+<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-16-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-16-0 http://www.eiffel.com/developers/xml/configuration-1-16-0.xsd" name="hal" uuid="94C384A6-8CAD-48C2-B448-EFA81264AFFD" library_target="hal">
+
 	<target name="hal">
 		<root all_classes="true"/>
-		<option warning="true" syntax="transitional">
+		<option warning="true">
 			<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
 		</option>
+
 		<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
 		<library name="json" location="$ISE_LIBRARY\contrib\library\text\parser\json\library\json.ecf"/>
 		<library name="uri_template" location="$ISE_LIBRARY\contrib\library\text\parser\uri_template\uri_template.ecf"/>
diff --git a/library/hal_resource.e b/library/hal_resource.e
index d622fa2..a6db908 100644
--- a/library/hal_resource.e
+++ b/library/hal_resource.e
@@ -152,6 +152,175 @@ feature -- Access
 			end
 		end
 
+	field_integer_by_key (a_key: READABLE_STRING_GENERAL): INTEGER_64
+			-- Return a value, if key `a_key' exists and is integer.
+		require
+			is_field_integer: field_is_integer (a_key)
+		do
+			if
+				attached fields as l_fields and then
+				attached {INTEGER_64} l_fields [a_key] as l_value
+			then
+				Result := l_value
+			end
+		end
+
+	field_real_by_key (a_key: READABLE_STRING_GENERAL): REAL_64
+			-- Return a value, if key `a_key' exists and is real.
+		require
+			is_field_integer: field_is_real (a_key)
+		do
+			if
+				attached fields as l_fields and then
+				attached {REAL_64} l_fields [a_key] as l_value
+			then
+				Result := l_value
+			end
+		end
+
+	field_natural_by_key (a_key: READABLE_STRING_GENERAL): NATURAL_64
+			-- Return a value, if key `a_key' exists and is natural.
+		require
+			is_field_integer: field_is_natural (a_key)
+		do
+			if
+				attached fields as l_fields and then
+				attached {NATURAL_64} l_fields [a_key] as l_value
+			then
+				Result := l_value
+			end
+		end
+
+	field_boolean_by_key (a_key: READABLE_STRING_GENERAL): BOOLEAN
+			-- Return a value, if key `a_key' exists and is boolean.
+		require
+			is_field_integer: field_is_boolean (a_key)
+		do
+			if
+				attached fields as l_fields and then
+				attached {BOOLEAN} l_fields [a_key] as l_value
+			then
+				Result := l_value
+			end
+		end
+
+	field_string_by_key (a_key: READABLE_STRING_GENERAL): detachable STRING_32
+			-- Return a value, if key `a_key' exists and is string.
+		require
+			is_field_integer: field_is_string (a_key)
+		do
+			if
+				attached fields as l_fields and then
+				attached {READABLE_STRING_32} l_fields [a_key] as l_value
+			then
+				Result := l_value
+			end
+		end
+
+	field_object_by_key (a_key: READABLE_STRING_GENERAL): detachable STRING_TABLE [ANY]
+			-- Return a value, if key `a_key' exists and is an object reference.
+		require
+			is_field_integer: field_is_object (a_key)
+		do
+			if
+				attached fields as l_fields and then
+				attached {STRING_TABLE [ANY]} l_fields [a_key] as l_value
+			then
+				Result := l_value
+			end
+		end
+
+	field_array_by_key (a_key: READABLE_STRING_GENERAL): detachable ARRAY [ANY]
+			-- Return a value, if key `a_key' exists and is an array reference.
+		require
+			is_field_integer: field_is_array (a_key)
+		do
+			if
+				attached fields as l_fields and then
+				attached {ARRAY [ANY]} l_fields [a_key] as l_value
+			then
+				Result := l_value
+			end
+		end
+
+feature -- Status Report
+
+	field_is_integer (a_key: READABLE_STRING_GENERAL): BOOLEAN
+			-- is the field `a_key' integer?
+		do
+			if
+				attached fields as l_fields and then
+				attached {INTEGER_64} l_fields [a_key]
+			then
+				Result := True
+			end
+		end
+
+	field_is_real (a_key: READABLE_STRING_GENERAL): BOOLEAN
+			-- is the field `a_key' real?
+		do
+			if
+				attached fields as l_fields and then
+				attached {REAL_64} l_fields [a_key]
+			then
+				Result := True
+			end
+		end
+
+	field_is_natural (a_key: READABLE_STRING_GENERAL): BOOLEAN
+			-- is the field `a_key' natural?
+		do
+			if
+				attached fields as l_fields and then
+				attached {NATURAL_64} l_fields [a_key]
+			then
+				Result := True
+			end
+		end
+
+	field_is_boolean (a_key: READABLE_STRING_GENERAL): BOOLEAN
+			-- is the field `a_key' boolean?
+		do
+			if
+				attached fields as l_fields and then
+				attached {BOOLEAN} l_fields [a_key]
+			then
+				Result := True
+			end
+		end
+
+	field_is_string (a_key: READABLE_STRING_GENERAL): BOOLEAN
+			-- is the field `a_key' string?
+		do
+			if
+				attached fields as l_fields and then
+				attached {READABLE_STRING_32} l_fields [a_key]
+			then
+				Result := True
+			end
+		end
+
+	field_is_object (a_key: READABLE_STRING_GENERAL): BOOLEAN
+			-- is the field `a_key' string_table?
+		do
+			if
+				attached fields as l_fields and then
+				attached {STRING_TABLE [ANY]} l_fields [a_key]
+			then
+				Result := True
+			end
+		end
+
+	field_is_array (a_key: READABLE_STRING_GENERAL): BOOLEAN
+			-- is the field `a_key' array?
+		do
+			if
+				attached fields as l_fields and then
+				attached {ARRAY [ANY]} l_fields [a_key]
+			then
+				Result := True
+			end
+		end
 
 feature -- Element Change
 
@@ -292,6 +461,29 @@ feature -- Element Change
 			l_fields.force ("null", key)
 		end
 
+	add_array_field (key: READABLE_STRING_GENERAL; a_array: ARRAY [ANY])
+		local
+			l_fields: like fields
+		do
+			l_fields := fields
+			if l_fields = Void then
+				create l_fields.make (1)
+				fields := l_fields
+			end
+			l_fields.force (a_array, key)
+		end
+
+	add_object_field (key: READABLE_STRING_GENERAL; a_object: STRING_TABLE [ANY])
+		local
+			l_fields: like fields
+		do
+			l_fields := fields
+			if l_fields = Void then
+				create l_fields.make (1)
+				fields := l_fields
+			end
+			l_fields.force (a_object, key)
+		end
 
 	add_embedded_resource_with_key (key: READABLE_STRING_GENERAL; res: HAL_RESOURCE)
 		local
diff --git a/test/application.e b/test/application.e
index d188c39..7f97be5 100644
--- a/test/application.e
+++ b/test/application.e
@@ -18,17 +18,17 @@ feature {NONE} -- Initialization
 	make
 		do
 			create file_reader
---			test_json_min
---			test_json_hal
-----			test_json_link
---			test_hal
---			test_item_line_item
---			test_order
---			test_hal_types
+			test_json_min
+			test_json_hal
+--			test_json_link
+			test_hal
+			test_item_line_item
+			test_order
+			test_hal_types
 			test_example_with_nested_objects
 
---			example_from_hal_to_domain
---			test_build_hal_json
+			example_from_hal_to_domain
+			test_build_hal_json
 		end
 
 	test_build_hal_json
@@ -243,6 +243,30 @@ feature {NONE} -- Initialization
 						if attached conv.to_json (r) as jv then
 							print (jv.representation)
 						end
+							-- expired is BOOLEAN
+						if r.field_is_integer ("expired") then
+							print ("%N")
+							print (r.field_integer_by_key ("expired").out)
+						end
+						if r.field_is_boolean ("expired") then
+							print ("%N")
+							print (r.field_boolean_by_key ("expired").out)
+						end
+							-- Integer
+						if r.field_is_integer ("age") then
+							print ("%N")
+							print (r.field_integer_by_key ("age").out)
+						end
+							-- Array with String table
+						if r.field_is_array ("children") then
+							if attached r.field_array_by_key ("children") as l_array then
+								across l_array as ic loop
+									print ("%N")
+									print (ic.item.out)
+								end
+							end
+						end
+
 					end
 				end
 			end
diff --git a/test/test_suite.ecf b/test/test_suite.ecf
index 77f9c0d..b6b0c4d 100644
--- a/test/test_suite.ecf
+++ b/test/test_suite.ecf
@@ -1,15 +1,18 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-9-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-9-0 http://www.eiffel.com/developers/xml/configuration-1-9-0.xsd" name="test" uuid="68E0C364-BA4A-4472-B21F-ADB370B0426F">
+<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-17-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-17-0 http://www.eiffel.com/developers/xml/configuration-1-17-0.xsd" name="test" uuid="68E0C364-BA4A-4472-B21F-ADB370B0426F">
 	<target name="test_suite">
 		<root cluster="test" class="APPLICATION" feature="make"/>
 		<file_rule>
-			<exclude>/EIFGENs$</exclude>
-			<exclude>/CVS$</exclude>
 			<exclude>/.svn$</exclude>
+			<exclude>/CVS$</exclude>
+			<exclude>/EIFGENs$</exclude>
 		</file_rule>
-		<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all">
+		<option warning="true">
 			<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
 		</option>
+		<capability>
+			<concurrency use="none"/>
+		</capability>
 		<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
 		<library name="hal" location="..\library\hal-safe.ecf" readonly="false"/>
 		<library name="json" location="$ISE_LIBRARY\contrib\library\text\parser\json\library\json-safe.ecf"/>

From a5e01cb35ccbc485eac99c92d3ae9e3ae49b0d36 Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Thu, 17 Aug 2017 10:53:17 -0300
Subject: [PATCH 27/47] Updated code based on code review.

---
 .../hal_resource_json_deserializer.e          |  53 +++++---
 .../converter/hal_resource_json_serializer.e  |   2 +-
 library/hal_resource.e                        | 122 +++++++++---------
 test/application.e                            |  25 ++--
 4 files changed, 105 insertions(+), 97 deletions(-)

diff --git a/library/converter/hal_resource_json_deserializer.e b/library/converter/hal_resource_json_deserializer.e
index 6bc079a..5583e0b 100644
--- a/library/converter/hal_resource_json_deserializer.e
+++ b/library/converter/hal_resource_json_deserializer.e
@@ -19,9 +19,8 @@ feature -- Conversion
 			l_list: LIST [HAL_RESOURCE]
 			js: JSON_STRING
 			l_any: detachable ANY
-			err: DEVELOPER_EXCEPTION
-			l_table: STRING_TABLE [ANY]
-			l_array: ARRAY [ANY]
+			l_table: STRING_TABLE [detachable ANY]
+			l_array: ARRAY [detachable ANY]
 		do
 			if attached {JSON_OBJECT} a_json as j then
 				create Result.make
@@ -58,9 +57,7 @@ feature -- Conversion
 								add_reference_field (j_array, l_array)
 								Result.add_array_field (js.item, l_array)
 							else
-								-- Unexpected value
-								create err
-								err.set_description ("Unexpected JSON representation: [ " + j_rep.representation + " ]")
+								on_unexpected_value ("Unexpected JSON representation: [ " + j_rep.representation + " ]")
 							end
 						end
 					end
@@ -100,6 +97,19 @@ feature -- Conversion
 			end
 		end
 
+
+feature {NONE} -- Error
+
+	on_unexpected_value (a_message: READABLE_STRING_32)
+			-- Raise a developer exception with message `a_message'.s
+		local
+			err: DEVELOPER_EXCEPTION
+		do
+				-- Unexpected value
+			create err
+			err.set_description (a_message)
+		end
+
 feature {NONE} -- Converter implementation
 
 	from_json_link (j: JSON_OBJECT; ctx: detachable JSON_DESERIALIZER_CONTEXT): STRING_TABLE [HAL_LINK]
@@ -174,19 +184,22 @@ feature {NONE} -- Converter implementation
 			end
 		end
 
-	add_reference_field (a_object: JSON_VALUE; a_reference: ANY )
-			-- Add hal Reference fields
-			-- JSON_OBJECTS or JSON_ARRAYS.
+	add_reference_field (a_value: JSON_VALUE; a_reference: ANY )
+			-- Add the field represented by `a_value' (a JSON_OBJECT or JSON_ARRAY)
+			-- into the corresponding `a_reference' data structure (STRING_TABLE [ANY]
+			-- or ARRAY [ANY]).
+			-- Raise a developer exception if it found an unexpected value.
+
 		local
 			js: JSON_STRING
-			l_table: STRING_TABLE [ANY]
-			l_array: ARRAY [ANY]
+			l_table: STRING_TABLE [detachable ANY]
+			l_array: ARRAY [detachable ANY]
 			err: DEVELOPER_EXCEPTION
 			i: INTEGER
 		do
 			if
-				attached {JSON_OBJECT} a_object as j and then
-				attached {STRING_TABLE [ANY]} a_reference as a_table
+				attached {JSON_OBJECT} a_value as j and then
+				attached {STRING_TABLE [detachable ANY]} a_reference as a_table
 			then
 				across
 					j.current_keys as ic
@@ -221,16 +234,15 @@ feature {NONE} -- Converter implementation
 								add_reference_field (j_array, l_array)
 								a_table.force (l_array, js.item)
 							else
-								-- Unexpected value
-								create err
-								err.set_description ("Unexpected JSON representation: [ " + j_rep.representation + " ]")
+									-- Unexpected value
+								on_unexpected_value ("Unexpected JSON representation: [ " + j_rep.representation + " ]")
 							end
 						end
 					end
 				end
 			elseif
-				attached {JSON_ARRAY} a_object as j_array and then
-				attached {ARRAY [ANY]} a_reference as a_array
+				attached {JSON_ARRAY} a_value as j_array and then
+				attached {ARRAY [detachable ANY]} a_reference as a_array
 			then
 				i := 1
 				across j_array as ic  loop
@@ -260,9 +272,8 @@ feature {NONE} -- Converter implementation
 							add_reference_field (j_array, l_array)
 							a_array.force (l_array, i)
 						else
-							-- Unexpected value
-							create err
-							err.set_description ("Unexpected JSON representation: [ " + ic.item.representation + " ]")
+								-- Unexpected value
+							on_unexpected_value ("Unexpected JSON representation: [ " + ic.item.representation + " ]")
 						end
 					end
 					i := i + 1
diff --git a/library/converter/hal_resource_json_serializer.e b/library/converter/hal_resource_json_serializer.e
index f01a8ce..c99cc04 100644
--- a/library/converter/hal_resource_json_serializer.e
+++ b/library/converter/hal_resource_json_serializer.e
@@ -147,7 +147,7 @@ feature {NONE} -- Converter implementation
 
 		end
 
-	to_json_value (a_obj: ANY): JSON_VALUE
+	to_json_value (a_obj: detachable ANY): JSON_VALUE
 			-- Convert an object `a_obj' to JSON_VALUE representation.
 		local
 			obj: ANY
diff --git a/library/hal_resource.e b/library/hal_resource.e
index a6db908..d391935 100644
--- a/library/hal_resource.e
+++ b/library/hal_resource.e
@@ -24,7 +24,7 @@ feature {NONE} -- Initialization
 		end
 
 	make_with_link (a_link: HAL_LINK)
-			-- Create a new resource with his self.link `a_link'
+			-- Create a new resource with his self.link `a_link'.
 		do
 			make
 			add_link_with_key ("self", a_link)
@@ -118,8 +118,7 @@ feature -- Access
 		end
 
 	embedded_resources_keys: detachable ARRAY [READABLE_STRING_GENERAL]
-			-- Retrieve an arrray of resource keys, if exist,
-			-- Void in othercase
+			-- Retrieve an arrray of resource keys, if exist,Void in other case.
 		do
 			if attached embedded_resource as er then
 				Result := er.current_keys
@@ -127,7 +126,7 @@ feature -- Access
 		end
 
 	embedded_resources_by_key (a_key: READABLE_STRING_GENERAL): detachable LIST [HAL_RESOURCE]
-			-- Return a list embedded resources if it exist or Void in other case
+			-- Return a list embedded resources if it exist or Void in other case.
 		do
 			if attached embedded_resource as er then
 				Result := er [a_key]
@@ -135,109 +134,110 @@ feature -- Access
 		end
 
 	fields_keys: detachable ARRAY [READABLE_STRING_GENERAL]
-			-- Return an array of fields keys if exist,
-			-- Void in othercase
+			-- Return an array of fields keys if exist, Void in other case.
 		do
 			if attached fields as p then
 				Result := p.current_keys
 			end
 		end
 
+	fields_by_key (a_key: READABLE_STRING_GENERAL): detachable READABLE_STRING_32
+			-- Return a string value, if key `a_key' exists, Void in other case.
+		obsolete
+			"Use *_field_by_key [2017-11-31]."
+		do
+			if attached {STRING_32} field_by_key (a_key) as l_value then
+				Result := l_value
+			end
+		end
+
 	field_by_key (a_key: READABLE_STRING_GENERAL): detachable ANY
-			-- Return a value, if key `a_key' exists
-			-- Void in othercase
+			-- Return a value, if key `a_key' exists, Void in other case.
 		do
 			if attached fields as l_fields then
 				Result := l_fields [a_key]
 			end
 		end
 
-	field_integer_by_key (a_key: READABLE_STRING_GENERAL): INTEGER_64
+	integer_field_by_key (a_key: READABLE_STRING_GENERAL): INTEGER_64
 			-- Return a value, if key `a_key' exists and is integer.
 		require
-			is_field_integer: field_is_integer (a_key)
+			is_field_integer: is_integer_field (a_key)
 		do
 			if
-				attached fields as l_fields and then
-				attached {INTEGER_64} l_fields [a_key] as l_value
+				attached {INTEGER_64} field_by_key (a_key) as l_value
 			then
 				Result := l_value
 			end
 		end
 
-	field_real_by_key (a_key: READABLE_STRING_GENERAL): REAL_64
+	real_field_by_key (a_key: READABLE_STRING_GENERAL): REAL_64
 			-- Return a value, if key `a_key' exists and is real.
 		require
-			is_field_integer: field_is_real (a_key)
+			is_field_integer: is_real_field (a_key)
 		do
 			if
-				attached fields as l_fields and then
-				attached {REAL_64} l_fields [a_key] as l_value
+				attached {REAL_64} field_by_key (a_key) as l_value
 			then
 				Result := l_value
 			end
 		end
 
-	field_natural_by_key (a_key: READABLE_STRING_GENERAL): NATURAL_64
+	natural_field_by_key (a_key: READABLE_STRING_GENERAL): NATURAL_64
 			-- Return a value, if key `a_key' exists and is natural.
 		require
-			is_field_integer: field_is_natural (a_key)
+			is_field_integer: is_natural_field (a_key)
 		do
 			if
-				attached fields as l_fields and then
-				attached {NATURAL_64} l_fields [a_key] as l_value
+				attached {NATURAL_64} field_by_key (a_key) as l_value
 			then
 				Result := l_value
 			end
 		end
 
-	field_boolean_by_key (a_key: READABLE_STRING_GENERAL): BOOLEAN
+	boolean_field_by_key (a_key: READABLE_STRING_GENERAL): BOOLEAN
 			-- Return a value, if key `a_key' exists and is boolean.
 		require
-			is_field_integer: field_is_boolean (a_key)
+			is_field_integer: is_boolean_field (a_key)
 		do
 			if
-				attached fields as l_fields and then
-				attached {BOOLEAN} l_fields [a_key] as l_value
+				attached {BOOLEAN} field_by_key (a_key) as l_value
 			then
 				Result := l_value
 			end
 		end
 
-	field_string_by_key (a_key: READABLE_STRING_GENERAL): detachable STRING_32
+	string_field_by_key (a_key: READABLE_STRING_GENERAL): detachable STRING_32
 			-- Return a value, if key `a_key' exists and is string.
 		require
-			is_field_integer: field_is_string (a_key)
+			is_field_integer: is_string_field (a_key)
 		do
 			if
-				attached fields as l_fields and then
-				attached {READABLE_STRING_32} l_fields [a_key] as l_value
+				attached {READABLE_STRING_32} field_by_key (a_key) as l_value
 			then
 				Result := l_value
 			end
 		end
 
-	field_object_by_key (a_key: READABLE_STRING_GENERAL): detachable STRING_TABLE [ANY]
+	object_field_by_key (a_key: READABLE_STRING_GENERAL): detachable STRING_TABLE [detachable ANY]
 			-- Return a value, if key `a_key' exists and is an object reference.
 		require
-			is_field_integer: field_is_object (a_key)
+			is_field_integer: is_object_field (a_key)
 		do
 			if
-				attached fields as l_fields and then
-				attached {STRING_TABLE [ANY]} l_fields [a_key] as l_value
+				attached {STRING_TABLE [detachable ANY]} field_by_key (a_key) as l_value
 			then
 				Result := l_value
 			end
 		end
 
-	field_array_by_key (a_key: READABLE_STRING_GENERAL): detachable ARRAY [ANY]
+	array_field_by_key (a_key: READABLE_STRING_GENERAL): detachable ARRAY [detachable ANY]
 			-- Return a value, if key `a_key' exists and is an array reference.
 		require
-			is_field_integer: field_is_array (a_key)
+			is_field_integer: is_array_field (a_key)
 		do
 			if
-				attached fields as l_fields and then
-				attached {ARRAY [ANY]} l_fields [a_key] as l_value
+				attached {ARRAY [detachable ANY]} field_by_key (a_key) as l_value
 			then
 				Result := l_value
 			end
@@ -245,78 +245,71 @@ feature -- Access
 
 feature -- Status Report
 
-	field_is_integer (a_key: READABLE_STRING_GENERAL): BOOLEAN
+	is_integer_field (a_key: READABLE_STRING_GENERAL): BOOLEAN
 			-- is the field `a_key' integer?
 		do
 			if
-				attached fields as l_fields and then
-				attached {INTEGER_64} l_fields [a_key]
+				attached {INTEGER_64} field_by_key (a_key)
 			then
 				Result := True
 			end
 		end
 
-	field_is_real (a_key: READABLE_STRING_GENERAL): BOOLEAN
+	is_real_field (a_key: READABLE_STRING_GENERAL): BOOLEAN
 			-- is the field `a_key' real?
 		do
 			if
-				attached fields as l_fields and then
-				attached {REAL_64} l_fields [a_key]
+				attached {REAL_64} field_by_key (a_key)
 			then
 				Result := True
 			end
 		end
 
-	field_is_natural (a_key: READABLE_STRING_GENERAL): BOOLEAN
+	is_natural_field (a_key: READABLE_STRING_GENERAL): BOOLEAN
 			-- is the field `a_key' natural?
 		do
 			if
-				attached fields as l_fields and then
-				attached {NATURAL_64} l_fields [a_key]
+				attached {NATURAL_64} field_by_key (a_key)
 			then
 				Result := True
 			end
 		end
 
-	field_is_boolean (a_key: READABLE_STRING_GENERAL): BOOLEAN
+	is_boolean_field (a_key: READABLE_STRING_GENERAL): BOOLEAN
 			-- is the field `a_key' boolean?
 		do
 			if
-				attached fields as l_fields and then
-				attached {BOOLEAN} l_fields [a_key]
+				attached {BOOLEAN} field_by_key (a_key)
 			then
 				Result := True
 			end
 		end
 
-	field_is_string (a_key: READABLE_STRING_GENERAL): BOOLEAN
+	is_string_field (a_key: READABLE_STRING_GENERAL): BOOLEAN
 			-- is the field `a_key' string?
 		do
 			if
-				attached fields as l_fields and then
-				attached {READABLE_STRING_32} l_fields [a_key]
+				attached {READABLE_STRING_32} field_by_key (a_key)
 			then
 				Result := True
 			end
 		end
 
-	field_is_object (a_key: READABLE_STRING_GENERAL): BOOLEAN
+	is_object_field (a_key: READABLE_STRING_GENERAL): BOOLEAN
 			-- is the field `a_key' string_table?
 		do
 			if
-				attached fields as l_fields and then
-				attached {STRING_TABLE [ANY]} l_fields [a_key]
+				attached {STRING_TABLE [detachable ANY]} field_by_key (a_key)
 			then
 				Result := True
 			end
 		end
 
-	field_is_array (a_key: READABLE_STRING_GENERAL): BOOLEAN
+	is_array_field (a_key: READABLE_STRING_GENERAL): BOOLEAN
 			-- is the field `a_key' array?
 		do
 			if
-				attached fields as l_fields and then
-				attached {ARRAY [ANY]} l_fields [a_key]
+				attached {ARRAY [detachable ANY]} field_by_key (a_key)
 			then
 				Result := True
 			end
@@ -325,6 +318,7 @@ feature -- Status Report
 feature -- Element Change
 
 	add_all_links (all_link: STRING_TABLE [HAL_LINK])
+			-- add all_links `all_link' to `links'.
 		do
 			across
 				all_link as ic
@@ -357,27 +351,27 @@ feature -- Element Change
 		end
 
 	add_link (a_link: HAL_LINK)
+			-- Add a link `a_link' to the `links'.
 		do
 			add_link_with_key (a_link.rel, a_link)
 		end
 
 	add_curie_link (a_attribute: HAL_LINK_ATTRIBUTE)
+			-- Add a curie link `a_atribute' to `links'.
 		do
 			add_link_with_key ("curies", create {HAL_LINK}.make_with_attribute ("curies", a_attribute))
 		end
 
 	add_fields (key: READABLE_STRING_GENERAL; value: ANY)
 		obsolete
-			"Use `add_field` [2017-06-20]"
+			"Use `add_field` [2017-06-20]."
 		do
 			add_field (key, value)
 		end
 
 	add_field (key: READABLE_STRING_GENERAL; value: ANY)
 		obsolete
-				"[
-					Use `dd_string_field, add_integer_field, add_real_field, add_natural_field, add_boolean_field, add_null_field [2017-06-20]
-					]"
+				"Use `add_*_field [2017-06-20]."
 		local
 			l_fields: like fields
 		do
@@ -461,7 +455,7 @@ feature -- Element Change
 			l_fields.force ("null", key)
 		end
 
-	add_array_field (key: READABLE_STRING_GENERAL; a_array: ARRAY [ANY])
+	add_array_field (key: READABLE_STRING_GENERAL; a_array: ARRAY [detachable ANY])
 		local
 			l_fields: like fields
 		do
@@ -473,7 +467,7 @@ feature -- Element Change
 			l_fields.force (a_array, key)
 		end
 
-	add_object_field (key: READABLE_STRING_GENERAL; a_object: STRING_TABLE [ANY])
+	add_object_field (key: READABLE_STRING_GENERAL; a_object: STRING_TABLE [detachable ANY])
 		local
 			l_fields: like fields
 		do
@@ -531,7 +525,7 @@ feature {HAL_ACCESS} -- Implementation
 	embedded_resource: detachable STRING_TABLE [LIST [HAL_RESOURCE]]
 			-- expressing the embedded nature of a given part of the representation.
 
-	fields: detachable STRING_TABLE [ANY]
+	fields: detachable STRING_TABLE [detachable ANY]
 			-- Properties representing current state of Current resource.
 
 
diff --git a/test/application.e b/test/application.e
index 7f97be5..6942c0a 100644
--- a/test/application.e
+++ b/test/application.e
@@ -27,8 +27,8 @@ feature {NONE} -- Initialization
 			test_hal_types
 			test_example_with_nested_objects
 
-			example_from_hal_to_domain
-			test_build_hal_json
+--			example_from_hal_to_domain
+--			test_build_hal_json
 		end
 
 	test_build_hal_json
@@ -244,25 +244,28 @@ feature {NONE} -- Initialization
 							print (jv.representation)
 						end
 							-- expired is BOOLEAN
-						if r.field_is_integer ("expired") then
+						if r.is_integer_field ("expired") then
 							print ("%N")
-							print (r.field_integer_by_key ("expired").out)
+							print (r.integer_field_by_key ("expired").out)
 						end
-						if r.field_is_boolean ("expired") then
+						if r.is_boolean_field ("expired") then
 							print ("%N")
-							print (r.field_boolean_by_key ("expired").out)
+							print (r.boolean_field_by_key ("expired").out)
 						end
 							-- Integer
-						if r.field_is_integer ("age") then
+						if r.is_integer_field ("age") then
 							print ("%N")
-							print (r.field_integer_by_key ("age").out)
+							print (r.integer_field_by_key ("age").out)
 						end
 							-- Array with String table
-						if r.field_is_array ("children") then
-							if attached r.field_array_by_key ("children") as l_array then
+						if r.is_array_field ("children") then
+							if attached r.array_field_by_key ("children") as l_array then
 								across l_array as ic loop
 									print ("%N")
-									print (ic.item.out)
+									if attached ic.item as l_item then
+										print (l_item.out)
+									end
+
 								end
 							end
 						end

From bd81e3560e0ba773e89de7fd228c645521e43b1b Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Thu, 17 Aug 2017 12:36:41 -0300
Subject: [PATCH 28/47] Clean code: removed unused local variables. Refactor
 code: replaced feature on_unexpected_value with a check instruction. Refactor
 renam: `*_field_by_name` to `*_field`. Updated code to support different
 INTEGERs{8,16,32,64}, NATURALs{8,16,32,64}, and REALs {32,64} value.

---
 .../hal_resource_json_deserializer.e          | 21 +------
 .../converter/hal_resource_json_serializer.e  |  1 -
 library/hal_resource.e                        | 41 ++++++++++----
 test/application.e                            | 55 ++++++++++++++-----
 4 files changed, 74 insertions(+), 44 deletions(-)

diff --git a/library/converter/hal_resource_json_deserializer.e b/library/converter/hal_resource_json_deserializer.e
index 5583e0b..2635d17 100644
--- a/library/converter/hal_resource_json_deserializer.e
+++ b/library/converter/hal_resource_json_deserializer.e
@@ -18,7 +18,6 @@ feature -- Conversion
 		local
 			l_list: LIST [HAL_RESOURCE]
 			js: JSON_STRING
-			l_any: detachable ANY
 			l_table: STRING_TABLE [detachable ANY]
 			l_array: ARRAY [detachable ANY]
 		do
@@ -57,7 +56,7 @@ feature -- Conversion
 								add_reference_field (j_array, l_array)
 								Result.add_array_field (js.item, l_array)
 							else
-								on_unexpected_value ("Unexpected JSON representation: [ " + j_rep.representation + " ]")
+								check known_json_value: False end
 							end
 						end
 					end
@@ -97,19 +96,6 @@ feature -- Conversion
 			end
 		end
 
-
-feature {NONE} -- Error
-
-	on_unexpected_value (a_message: READABLE_STRING_32)
-			-- Raise a developer exception with message `a_message'.s
-		local
-			err: DEVELOPER_EXCEPTION
-		do
-				-- Unexpected value
-			create err
-			err.set_description (a_message)
-		end
-
 feature {NONE} -- Converter implementation
 
 	from_json_link (j: JSON_OBJECT; ctx: detachable JSON_DESERIALIZER_CONTEXT): STRING_TABLE [HAL_LINK]
@@ -194,7 +180,6 @@ feature {NONE} -- Converter implementation
 			js: JSON_STRING
 			l_table: STRING_TABLE [detachable ANY]
 			l_array: ARRAY [detachable ANY]
-			err: DEVELOPER_EXCEPTION
 			i: INTEGER
 		do
 			if
@@ -235,7 +220,7 @@ feature {NONE} -- Converter implementation
 								a_table.force (l_array, js.item)
 							else
 									-- Unexpected value
-								on_unexpected_value ("Unexpected JSON representation: [ " + j_rep.representation + " ]")
+								check known_json_value: False end
 							end
 						end
 					end
@@ -273,7 +258,7 @@ feature {NONE} -- Converter implementation
 							a_array.force (l_array, i)
 						else
 								-- Unexpected value
-							on_unexpected_value ("Unexpected JSON representation: [ " + ic.item.representation + " ]")
+							check known_json_value: False end
 						end
 					end
 					i := i + 1
diff --git a/library/converter/hal_resource_json_serializer.e b/library/converter/hal_resource_json_serializer.e
index c99cc04..f2d5357 100644
--- a/library/converter/hal_resource_json_serializer.e
+++ b/library/converter/hal_resource_json_serializer.e
@@ -153,7 +153,6 @@ feature {NONE} -- Converter implementation
 			obj: ANY
 			conv_to: JSON_REFLECTOR_SERIALIZER
 			ctx: detachable JSON_SERIALIZER_CONTEXT
-			s: STRING
 		do
 			obj := a_obj
 
diff --git a/library/hal_resource.e b/library/hal_resource.e
index d391935..3d472d2 100644
--- a/library/hal_resource.e
+++ b/library/hal_resource.e
@@ -159,7 +159,7 @@ feature -- Access
 			end
 		end
 
-	integer_field_by_key (a_key: READABLE_STRING_GENERAL): INTEGER_64
+	integer_field (a_key: READABLE_STRING_GENERAL): INTEGER_64
 			-- Return a value, if key `a_key' exists and is integer.
 		require
 			is_field_integer: is_integer_field (a_key)
@@ -168,10 +168,17 @@ feature -- Access
 				attached {INTEGER_64} field_by_key (a_key) as l_value
 			then
 				Result := l_value
+			elseif attached {INTEGER_32} field_by_key (a_key) as l_value then
+				Result := l_value
+			elseif attached {INTEGER_16} field_by_key (a_key) as l_value then
+				Result := l_value
+			elseif attached {INTEGER_8} field_by_key (a_key) as l_value then
+				Result := l_value
 			end
+
 		end
 
-	real_field_by_key (a_key: READABLE_STRING_GENERAL): REAL_64
+	real_field (a_key: READABLE_STRING_GENERAL): REAL_64
 			-- Return a value, if key `a_key' exists and is real.
 		require
 			is_field_integer: is_real_field (a_key)
@@ -180,10 +187,12 @@ feature -- Access
 				attached {REAL_64} field_by_key (a_key) as l_value
 			then
 				Result := l_value
+			elseif 	attached {REAL_32} field_by_key (a_key) as l_value then
+				Result := l_value
 			end
 		end
 
-	natural_field_by_key (a_key: READABLE_STRING_GENERAL): NATURAL_64
+	natural_field (a_key: READABLE_STRING_GENERAL): NATURAL_64
 			-- Return a value, if key `a_key' exists and is natural.
 		require
 			is_field_integer: is_natural_field (a_key)
@@ -192,10 +201,16 @@ feature -- Access
 				attached {NATURAL_64} field_by_key (a_key) as l_value
 			then
 				Result := l_value
+			elseif attached {NATURAL_32} field_by_key (a_key) as l_value then
+				Result := l_value
+			elseif attached {NATURAL_16} field_by_key (a_key) as l_value then
+				Result := l_value
+			elseif attached {NATURAL_8} field_by_key (a_key) as l_value then
+				Result := l_value
 			end
 		end
 
-	boolean_field_by_key (a_key: READABLE_STRING_GENERAL): BOOLEAN
+	boolean_field (a_key: READABLE_STRING_GENERAL): BOOLEAN
 			-- Return a value, if key `a_key' exists and is boolean.
 		require
 			is_field_integer: is_boolean_field (a_key)
@@ -207,7 +222,7 @@ feature -- Access
 			end
 		end
 
-	string_field_by_key (a_key: READABLE_STRING_GENERAL): detachable STRING_32
+	string_field (a_key: READABLE_STRING_GENERAL): detachable STRING_32
 			-- Return a value, if key `a_key' exists and is string.
 		require
 			is_field_integer: is_string_field (a_key)
@@ -219,7 +234,7 @@ feature -- Access
 			end
 		end
 
-	object_field_by_key (a_key: READABLE_STRING_GENERAL): detachable STRING_TABLE [detachable ANY]
+	object_field (a_key: READABLE_STRING_GENERAL): detachable STRING_TABLE [detachable ANY]
 			-- Return a value, if key `a_key' exists and is an object reference.
 		require
 			is_field_integer: is_object_field (a_key)
@@ -231,7 +246,7 @@ feature -- Access
 			end
 		end
 
-	array_field_by_key (a_key: READABLE_STRING_GENERAL): detachable ARRAY [detachable ANY]
+	array_field (a_key: READABLE_STRING_GENERAL): detachable ARRAY [detachable ANY]
 			-- Return a value, if key `a_key' exists and is an array reference.
 		require
 			is_field_integer: is_array_field (a_key)
@@ -249,7 +264,9 @@ feature -- Status Report
 			-- is the field `a_key' integer?
 		do
 			if
-				attached {INTEGER_64} field_by_key (a_key)
+				attached {INTEGER_64} field_by_key (a_key) or else
+				attached {INTEGER_32} field_by_key (a_key) or else
+				attached {INTEGER_8} field_by_key (a_key)
 			then
 				Result := True
 			end
@@ -259,7 +276,8 @@ feature -- Status Report
 			-- is the field `a_key' real?
 		do
 			if
-				attached {REAL_64} field_by_key (a_key)
+				attached {REAL_64} field_by_key (a_key) or else
+				attached {REAL_32} field_by_key (a_key)
 			then
 				Result := True
 			end
@@ -269,7 +287,10 @@ feature -- Status Report
 			-- is the field `a_key' natural?
 		do
 			if
-				attached {NATURAL_64} field_by_key (a_key)
+				attached {NATURAL_64} field_by_key (a_key) or else
+				attached {NATURAL_32} field_by_key (a_key) or else
+				attached {NATURAL_16} field_by_key (a_key) or else
+				attached {NATURAL_8} field_by_key (a_key)
 			then
 				Result := True
 			end
diff --git a/test/application.e b/test/application.e
index 6942c0a..9883614 100644
--- a/test/application.e
+++ b/test/application.e
@@ -18,17 +18,18 @@ feature {NONE} -- Initialization
 	make
 		do
 			create file_reader
-			test_json_min
-			test_json_hal
---			test_json_link
-			test_hal
-			test_item_line_item
-			test_order
-			test_hal_types
-			test_example_with_nested_objects
-
---			example_from_hal_to_domain
---			test_build_hal_json
+--			test_json_min
+--			test_json_hal
+----			test_json_link
+--			test_hal
+--			test_item_line_item
+--			test_order
+--			test_hal_types
+--			test_example_with_nested_objects
+
+----			example_from_hal_to_domain
+----			test_build_hal_json
+			test_hal_values
 		end
 
 	test_build_hal_json
@@ -246,20 +247,20 @@ feature {NONE} -- Initialization
 							-- expired is BOOLEAN
 						if r.is_integer_field ("expired") then
 							print ("%N")
-							print (r.integer_field_by_key ("expired").out)
+							print (r.integer_field ("expired").out)
 						end
 						if r.is_boolean_field ("expired") then
 							print ("%N")
-							print (r.boolean_field_by_key ("expired").out)
+							print (r.boolean_field ("expired").out)
 						end
 							-- Integer
 						if r.is_integer_field ("age") then
 							print ("%N")
-							print (r.integer_field_by_key ("age").out)
+							print (r.integer_field ("age").out)
 						end
 							-- Array with String table
 						if r.is_array_field ("children") then
-							if attached r.array_field_by_key ("children") as l_array then
+							if attached r.array_field ("children") as l_array then
 								across l_array as ic loop
 									print ("%N")
 									if attached ic.item as l_item then
@@ -311,6 +312,30 @@ feature {NONE} -- Initialization
 			end
 		end
 
+	test_hal_values
+		local
+			l_hal: HAL_RESOURCE
+			l_int: INTEGER_64
+			l_nat: NATURAL_64
+			l_real: REAL_64
+		do
+			create l_hal.make
+			l_hal.add_field ("integer_8", {INTEGER_8}8)
+			check is_integer_8: l_hal.is_integer_field ("integer_8") end
+			l_int := l_hal.integer_field ("integer_8")
+			print ("%Nint " + l_int.out)
+
+			l_hal.add_field ("natural_8", {NATURAL}255)
+			check is_natural_8: l_hal.is_natural_field ("natural_8") end
+			l_nat := l_hal.natural_field ("natural_8")
+			print ("%Nnat " + l_nat.out)
+
+			l_hal.add_field ("real_32", {REAL}255.32)
+			check is_real_32: l_hal.is_real_field ("real_32") end
+			l_real := l_hal.real_field ("real_32")
+			print ("%Nreal " + l_real.out)
+		end
+
 feature -- Implementation
 
 	file_reader: JSON_FILE_READER

From 3774ee4a5a34fb6d909994b3d957676e65347825 Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Tue, 22 Aug 2017 12:15:11 -0300
Subject: [PATCH 29/47] Updated ecf to use 1-15 to keep compatibility with
 older compilers. Updated test cases.

---
 library/hal-safe.ecf       |  2 +-
 library/hal.ecf            |  2 +-
 test/hal_test_suite.e      | 11 -----------
 test/min_hal_document.json |  1 +
 test/test_suite.ecf        |  5 +----
 5 files changed, 4 insertions(+), 17 deletions(-)
 create mode 100644 test/min_hal_document.json

diff --git a/library/hal-safe.ecf b/library/hal-safe.ecf
index f632ea7..7d6696d 100644
--- a/library/hal-safe.ecf
+++ b/library/hal-safe.ecf
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-16-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-16-0 http://www.eiffel.com/developers/xml/configuration-1-16-0.xsd" name="hal" uuid="94C384A6-8CAD-48C2-B448-EFA81264AFFD" library_target="hal">
+<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="hal" uuid="94C384A6-8CAD-48C2-B448-EFA81264AFFD" library_target="hal">
 	<target name="hal">
 		<root all_classes="true"/>
 		<option warning="true">
diff --git a/library/hal.ecf b/library/hal.ecf
index c2ea226..21cf784 100644
--- a/library/hal.ecf
+++ b/library/hal.ecf
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-16-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-16-0 http://www.eiffel.com/developers/xml/configuration-1-16-0.xsd" name="hal" uuid="94C384A6-8CAD-48C2-B448-EFA81264AFFD" library_target="hal">
+<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="hal" uuid="94C384A6-8CAD-48C2-B448-EFA81264AFFD" library_target="hal">
 
 	<target name="hal">
 		<root all_classes="true"/>
diff --git a/test/hal_test_suite.e b/test/hal_test_suite.e
index d58278a..a9543cc 100644
--- a/test/hal_test_suite.e
+++ b/test/hal_test_suite.e
@@ -26,17 +26,6 @@ feature {NONE} -- Events
 
 feature -- Test routines
 
-	test_invalid_hal_document
-    		--
-		local
-			l_res : detachable HAL_RESOURCE
-		do
-			l_res := json_to_hal ("min_hal_wrong_document.json")
-			if l_res = Void then
-				assert("Invalid Hal document", True)
-			end
-		end
-
 	test_valid_hal_document
     		--
 		local
diff --git a/test/min_hal_document.json b/test/min_hal_document.json
new file mode 100644
index 0000000..9e26dfe
--- /dev/null
+++ b/test/min_hal_document.json
@@ -0,0 +1 @@
+{}
\ No newline at end of file
diff --git a/test/test_suite.ecf b/test/test_suite.ecf
index b6b0c4d..c49157e 100644
--- a/test/test_suite.ecf
+++ b/test/test_suite.ecf
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-17-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-17-0 http://www.eiffel.com/developers/xml/configuration-1-17-0.xsd" name="test" uuid="68E0C364-BA4A-4472-B21F-ADB370B0426F">
+<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="test" uuid="68E0C364-BA4A-4472-B21F-ADB370B0426F">
 	<target name="test_suite">
 		<root cluster="test" class="APPLICATION" feature="make"/>
 		<file_rule>
@@ -10,9 +10,6 @@
 		<option warning="true">
 			<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
 		</option>
-		<capability>
-			<concurrency use="none"/>
-		</capability>
 		<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
 		<library name="hal" location="..\library\hal-safe.ecf" readonly="false"/>
 		<library name="json" location="$ISE_LIBRARY\contrib\library\text\parser\json\library\json-safe.ecf"/>

From 2d9f6dbdb2d6b49c35a6ea27546fd0d358f41d3e Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Wed, 23 Aug 2017 10:06:34 -0300
Subject: [PATCH 30/47] Updated Hal specification link

---
 README => README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename README => README.md (79%)

diff --git a/README b/README.md
similarity index 79%
rename from README
rename to README.md
index f39397d..6dd7732 100644
--- a/README
+++ b/README.md
@@ -3,6 +3,6 @@ Eiffel HAL is a library to work with  http://stateless.co/hal_specification.html
 HAL is used for exposing RESTful hypermedia APIs. Right now the current implementation only support 
 JSON_HAL
 
-References
-http://tools.ietf.org/html/draft-kelly-json-hal-07
+## References
+http://tools.ietf.org/html/draft-kelly-json-hal-08
 http://stateless.co/hal_specification.html#json

From a0062d6bf47352a5a4ddf0f006fe5bfadbb9c120 Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Wed, 23 Aug 2017 10:12:15 -0300
Subject: [PATCH 31/47] Updated travis configuration file.

---
 .travis.yml | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 5decbc4..3ad422e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,19 +1,21 @@
 language: eiffel
 before_script:
-  - current_dir=$(pwd)
-  - cd ..
-  - wget https://ftp.eiffel.com/pub/beta/nightly/Eiffel_17.11_gpl_100608-linux-x86-64.tar.bz2  
-  - tar -xvf Eiffel_17.11_gpl_100608-linux-x86-64.tar.bz2
-  - export ISE_EIFFEL=$PWD/Eiffel_17.11
+  - export current_dir=$PWD ; echo current_dir=$current_dir ; cd ..
+  - export ISE_EIFFEL=$PWD/Eiffel_17.11; 
   - export ISE_PLATFORM=linux-x86-64
-  - export PATH=$PATH:$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
-  - export PATH=$PATH:$ISE_EIFFEL/tools/spec/$ISE_PLATFORM/bin
-  - cd current_dir
+  - curl -sSL https://ftp.eiffel.com/pub/beta/nightly/Eiffel_17.11_gpl_100608-linux-x86-64.tar.bz2 | tar -x --bzip2
+  - export PATH=$PATH:$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin:$PATH:$ISE_EIFFEL/tools/spec/$ISE_PLATFORM/bin
+  - echo `ec -version`
+  - cd $current_dir
 
 # safelist
 branches:
   only:
   - master
 
-script: compile_all -ecb -melt -list_failures -clean -options dotnet=false
+script: 
+  #compile code  
+  - compile_all -ecb -melt -list_failures -log_verbose -clean -options dotnet=false
+  #testing
+  - ec -config test/test_suite.ecf -c_compile -tests 
 

From bac150b08caac5afc29f559368310e955e94335e Mon Sep 17 00:00:00 2001
From: Javier Velilla <javier.hector@gmail.com>
Date: Wed, 23 Aug 2017 10:19:56 -0300
Subject: [PATCH 32/47] Updated Readme

Add Travis CI status
---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 7802307..818830c 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 Eiffel HAL is a library to work with  http://stateless.co/hal_specification.html#json
 
-Master: [![Build Status](https://travis-ci.org/jvelilla/HAL.svg?branch=hal_issue)](https://travis-ci.org/jvelilla/HAL)
+Master: [![Build Status](https://travis-ci.org/EiffelWebFramework/HAL.svg?branch=master)](https://travis-ci.org/EiffelWebFramework/HAL/)
 
 
 HAL is used for exposing RESTful hypermedia APIs. Right now the current implementation only support 

From 3ac9edc497649d0362bec5ace646ca73eaf1a46c Mon Sep 17 00:00:00 2001
From: Javier Velilla <javier.hector@gmail.com>
Date: Wed, 23 Aug 2017 10:22:22 -0300
Subject: [PATCH 33/47] Updated Readme

Added Travis CI status
---
 README.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/README.md b/README.md
index 6dd7732..93b6f19 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
 Eiffel HAL is a library to work with  http://stateless.co/hal_specification.html#json
 
+Master: [![Build Status](https://travis-ci.org/EiffelWebFramework/HAL.svg?branch=master)](https://travis-ci.org/EiffelWebFramework/HAL/)
+
 HAL is used for exposing RESTful hypermedia APIs. Right now the current implementation only support 
 JSON_HAL
 

From 3ab8b028afdfee63b772fd4087148fed2aca93f4 Mon Sep 17 00:00:00 2001
From: Javier Velilla <javier.hector@gmail.com>
Date: Wed, 23 Aug 2017 10:32:55 -0300
Subject: [PATCH 34/47] Updated Readme

Added Travis and Appveyor
---
 README.md | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 818830c..30ff898 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,6 @@
-Eiffel HAL is a library to work with  http://stateless.co/hal_specification.html#json
-
-Master: [![Build Status](https://travis-ci.org/EiffelWebFramework/HAL.svg?branch=master)](https://travis-ci.org/EiffelWebFramework/HAL/)
+|travis| |appveyor|
 
+Eiffel HAL is a library to work with  http://stateless.co/hal_specification.html#json
 
 HAL is used for exposing RESTful hypermedia APIs. Right now the current implementation only support 
 JSON_HAL

From 76da462027715237138b3dbbdd91975c961dea6e Mon Sep 17 00:00:00 2001
From: Javier Velilla <javier.hector@gmail.com>
Date: Wed, 23 Aug 2017 10:34:24 -0300
Subject: [PATCH 35/47] Update .appveyor.yml

Updated
---
 .appveyor.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.appveyor.yml b/.appveyor.yml
index 0b97644..cf8aed7 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -34,7 +34,7 @@ before_build:
 
 build_script:
   - cd C:\projects
-  - git clone https://github.com/jvelilla/HAL
+  - git clone https://github.com/EiffelWebFramework/HAL
   - cd HAL
   - compile_all -ecb -melt -list_failures -clean -options dotnet=false
 

From 32683b2326df2934c64499357fd13a9b6f78bdb5 Mon Sep 17 00:00:00 2001
From: Javier Velilla <javier.hector@gmail.com>
Date: Wed, 23 Aug 2017 10:39:15 -0300
Subject: [PATCH 36/47] Updated

---
 README.md | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 30ff898..4af5966 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,6 @@
-|travis| |appveyor|
+
+[![Build Status](https://travis-ci.org/jvelilla/hal.svg?branch=master)](https://travis-ci.org/jvelilla/hal) [![Appveyor Status](https://ci.appveyor.com/api/projects/status/github/jvelilla?branch=master&svg=true)](https://ci.appveyor.com/project/jvelilla/hal?branch=master)
+
 
 Eiffel HAL is a library to work with  http://stateless.co/hal_specification.html#json
 

From b407cf5b51f4fb042c5a24387c62c64880546125 Mon Sep 17 00:00:00 2001
From: Javier Velilla <javier.hector@gmail.com>
Date: Wed, 23 Aug 2017 10:43:47 -0300
Subject: [PATCH 37/47] Updated with AppVeyor Status

---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 4af5966..8678a8f 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 
-[![Build Status](https://travis-ci.org/jvelilla/hal.svg?branch=master)](https://travis-ci.org/jvelilla/hal) [![Appveyor Status](https://ci.appveyor.com/api/projects/status/github/jvelilla?branch=master&svg=true)](https://ci.appveyor.com/project/jvelilla/hal?branch=master)
-
+[![Build Status](https://travis-ci.org/jvelilla/hal.svg?branch=master)](https://travis-ci.org/jvelilla/hal) 
+[![AppVeyor status](https://ci.appveyor.com/api/projects/status/01094sp8soowwpku?svg=true)](https://ci.appveyor.com/project/jvelilla/hal-gahly)
 
 Eiffel HAL is a library to work with  http://stateless.co/hal_specification.html#json
 

From 9ce313994dd86dfc897436dd4c2d86c9872178f5 Mon Sep 17 00:00:00 2001
From: Javier Velilla <javier.hector@gmail.com>
Date: Wed, 23 Aug 2017 10:45:08 -0300
Subject: [PATCH 38/47] Updated Readme

Added Appveyor and Travis Status
---
 README.md | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 93b6f19..a164f87 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,8 @@
-Eiffel HAL is a library to work with  http://stateless.co/hal_specification.html#json
+[![Build Status](https://travis-ci.org/EiffelWebFramework/HAL.svg?branch=master)](https://travis-ci.org/EiffelWebFramework/HAL/)
+[![AppVeyor status](https://ci.appveyor.com/api/projects/status/01094sp8soowwpku?svg=true)](https://ci.appveyor.com/project/jvelilla/hal-gahly)
 
-Master: [![Build Status](https://travis-ci.org/EiffelWebFramework/HAL.svg?branch=master)](https://travis-ci.org/EiffelWebFramework/HAL/)
+# Eiffel HAL 
+Eiffel HAL is a library to work with  http://stateless.co/hal_specification.html#json
 
 HAL is used for exposing RESTful hypermedia APIs. Right now the current implementation only support 
 JSON_HAL

From 50aac8e1293d88b10947f9cfe7da6de0e88dba2f Mon Sep 17 00:00:00 2001
From: Javier Velilla <javier.hector@gmail.com>
Date: Wed, 23 Aug 2017 10:47:49 -0300
Subject: [PATCH 39/47] Updated Readme

Improved Style
---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index a164f87..62c3ddc 100644
--- a/README.md
+++ b/README.md
@@ -8,5 +8,5 @@ HAL is used for exposing RESTful hypermedia APIs. Right now the current implemen
 JSON_HAL
 
 ## References
-http://tools.ietf.org/html/draft-kelly-json-hal-08
-http://stateless.co/hal_specification.html#json
+* http://tools.ietf.org/html/draft-kelly-json-hal-08
+* http://stateless.co/hal_specification.html#json

From 01a36d58e988c8f28c3408c8b9fe0e5a9e843d30 Mon Sep 17 00:00:00 2001
From: Javier Velilla <javier.hector@gmail.com>
Date: Wed, 23 Aug 2017 10:56:05 -0300
Subject: [PATCH 40/47] Updated Readme

Updated appveyor configuration to use EiffelStudio from sourcegorge.
---
 .appveyor.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.appveyor.yml b/.appveyor.yml
index cf8aed7..9f7e12a 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -18,7 +18,7 @@ install:
   - mkdir C:\projects\eiffel
   - cd C:\projects\eiffel
 
-  - set EIFFELSTUDIO_URL="https://ftp.eiffel.com/pub/beta/nightly/Eiffel_17.11_gpl_100607-win64.7z"
+  - set EIFFELSTUDIO_URL="https://sourceforge.net/projects/eiffelstudio/files/EiffelStudio%2017.05/Build_100416/Eiffel_17.05_gpl_100416-windows.7z"
   - appveyor DownloadFile %EIFFELSTUDIO_URL% -FileName eiffel_studio.zip
   - 7z x eiffel_studio.zip -oC:\projects\eiffel\ > nul
   - cmd: set ISE_C_COMPILER=msc_vc140

From a664501170a888934dcada30441fd88c7d199bc9 Mon Sep 17 00:00:00 2001
From: Javier Velilla <javier.hector@gmail.com>
Date: Wed, 23 Aug 2017 11:08:19 -0300
Subject: [PATCH 41/47] Updated Appveyor

Updated link
---
 .appveyor.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.appveyor.yml b/.appveyor.yml
index 9f7e12a..0598063 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -18,7 +18,7 @@ install:
   - mkdir C:\projects\eiffel
   - cd C:\projects\eiffel
 
-  - set EIFFELSTUDIO_URL="https://sourceforge.net/projects/eiffelstudio/files/EiffelStudio%2017.05/Build_100416/Eiffel_17.05_gpl_100416-windows.7z"
+  - set EIFFELSTUDIO_URL="https://goo.gl/1RQMG7"
   - appveyor DownloadFile %EIFFELSTUDIO_URL% -FileName eiffel_studio.zip
   - 7z x eiffel_studio.zip -oC:\projects\eiffel\ > nul
   - cmd: set ISE_C_COMPILER=msc_vc140

From 57b80bcada94e9155aa973171e5380dcbd90b1fb Mon Sep 17 00:00:00 2001
From: Javier Velilla <javier.hector@gmail.com>
Date: Wed, 23 Aug 2017 11:11:05 -0300
Subject: [PATCH 42/47] Updated appveyor

Updated EiffelStudio version to 17.05
---
 .appveyor.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.appveyor.yml b/.appveyor.yml
index 0598063..c979d06 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -23,7 +23,7 @@ install:
   - 7z x eiffel_studio.zip -oC:\projects\eiffel\ > nul
   - cmd: set ISE_C_COMPILER=msc_vc140
   - cmd: set ISE_PLATFORM=win64
-  - cmd: set ISE_EIFFEL=C:\projects\eiffel\Eiffel_17.11 
+  - cmd: set ISE_EIFFEL=C:\projects\eiffel\Eiffel_17.05 
   - cmd: set PATH=%PATH%;%ISE_EIFFEL%/studio/spec/%ISE_PLATFORM%/bin;
   - cmd: set PATH=%PATH%;%ISE_EIFFEL%/tools/spec/%ISE_PLATFORM%/bin;
   - ec -version

From d23c16108c63097ad8581408ee1dfcd653db824c Mon Sep 17 00:00:00 2001
From: Javier Velilla <javier.hector@gmail.com>
Date: Wed, 23 Aug 2017 11:23:20 -0300
Subject: [PATCH 43/47] Updated AppVeyor

Back to 17.11
---
 .appveyor.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.appveyor.yml b/.appveyor.yml
index c979d06..cf8aed7 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -18,12 +18,12 @@ install:
   - mkdir C:\projects\eiffel
   - cd C:\projects\eiffel
 
-  - set EIFFELSTUDIO_URL="https://goo.gl/1RQMG7"
+  - set EIFFELSTUDIO_URL="https://ftp.eiffel.com/pub/beta/nightly/Eiffel_17.11_gpl_100607-win64.7z"
   - appveyor DownloadFile %EIFFELSTUDIO_URL% -FileName eiffel_studio.zip
   - 7z x eiffel_studio.zip -oC:\projects\eiffel\ > nul
   - cmd: set ISE_C_COMPILER=msc_vc140
   - cmd: set ISE_PLATFORM=win64
-  - cmd: set ISE_EIFFEL=C:\projects\eiffel\Eiffel_17.05 
+  - cmd: set ISE_EIFFEL=C:\projects\eiffel\Eiffel_17.11 
   - cmd: set PATH=%PATH%;%ISE_EIFFEL%/studio/spec/%ISE_PLATFORM%/bin;
   - cmd: set PATH=%PATH%;%ISE_EIFFEL%/tools/spec/%ISE_PLATFORM%/bin;
   - ec -version

From 13e806b19761f7efcfd2368eb587bc0cfbd1bdf1 Mon Sep 17 00:00:00 2001
From: Jocelyn Fiat <github@djoce.net>
Date: Wed, 18 Oct 2017 10:32:21 +0200
Subject: [PATCH 44/47] Fixed precondition tag names for *_field (..) .
 links_by_key is now obsolete and replaced by link_by_key. Updated autotest
 suite.

---
 library/hal_resource.e |  70 +++++++--------
 test/application.e     |  67 +++++++--------
 test/hal_test_suite.e  | 189 +++++++++++++++++------------------------
 test/test_suite.ecf    |   4 +-
 4 files changed, 142 insertions(+), 188 deletions(-)

diff --git a/library/hal_resource.e b/library/hal_resource.e
index 3d472d2..398ebed 100644
--- a/library/hal_resource.e
+++ b/library/hal_resource.e
@@ -99,6 +99,13 @@ feature -- Access
 		end
 
 	links_by_key (a_key: READABLE_STRING_GENERAL): detachable HAL_LINK
+		obsolete
+			"Use `link_by_key` [2017-11-31]"
+		do
+			Result := link_by_key (a_key)
+		end
+
+	link_by_key (a_key: READABLE_STRING_GENERAL): detachable HAL_LINK
 			-- Retrieve a link given a `a_key', ie a rel attribute if it exist,
 			-- Void in othercase
 			-- For example if you have the following JSON representation
@@ -144,7 +151,7 @@ feature -- Access
 	fields_by_key (a_key: READABLE_STRING_GENERAL): detachable READABLE_STRING_32
 			-- Return a string value, if key `a_key' exists, Void in other case.
 		obsolete
-			"Use *_field_by_key [2017-11-31]."
+			"Use `field_by_key` or `*_field` [2017-11-31]."
 		do
 			if attached {STRING_32} field_by_key (a_key) as l_value then
 				Result := l_value
@@ -164,60 +171,51 @@ feature -- Access
 		require
 			is_field_integer: is_integer_field (a_key)
 		do
-			if
-				attached {INTEGER_64} field_by_key (a_key) as l_value
-			then
+			if attached {INTEGER_64} field_by_key (a_key) as l_value then
 				Result := l_value
 			elseif attached {INTEGER_32} field_by_key (a_key) as l_value then
-				Result := l_value
+				Result := l_value.to_integer_64
 			elseif attached {INTEGER_16} field_by_key (a_key) as l_value then
-				Result := l_value
+				Result := l_value.to_integer_64
 			elseif attached {INTEGER_8} field_by_key (a_key) as l_value then
-				Result := l_value
+				Result := l_value.to_integer_64
 			end
-
 		end
 
 	real_field (a_key: READABLE_STRING_GENERAL): REAL_64
 			-- Return a value, if key `a_key' exists and is real.
 		require
-			is_field_integer: is_real_field (a_key)
+			is_field_real: is_real_field (a_key)
 		do
-			if
-				attached {REAL_64} field_by_key (a_key) as l_value
-			then
-				Result := l_value
-			elseif 	attached {REAL_32} field_by_key (a_key) as l_value then
+			if attached {REAL_64} field_by_key (a_key) as l_value then
 				Result := l_value
+			elseif attached {REAL_32} field_by_key (a_key) as l_value then
+				Result := l_value.to_double
 			end
 		end
 
 	natural_field (a_key: READABLE_STRING_GENERAL): NATURAL_64
 			-- Return a value, if key `a_key' exists and is natural.
 		require
-			is_field_integer: is_natural_field (a_key)
+			is_field_natural: is_natural_field (a_key)
 		do
-			if
-				attached {NATURAL_64} field_by_key (a_key) as l_value
-			then
+			if attached {NATURAL_64} field_by_key (a_key) as l_value then
 				Result := l_value
 			elseif attached {NATURAL_32} field_by_key (a_key) as l_value then
-				Result := l_value
+				Result := l_value.to_natural_64
 			elseif attached {NATURAL_16} field_by_key (a_key) as l_value then
-				Result := l_value
+				Result := l_value.to_natural_64
 			elseif attached {NATURAL_8} field_by_key (a_key) as l_value then
-				Result := l_value
+				Result := l_value.to_natural_64
 			end
 		end
 
 	boolean_field (a_key: READABLE_STRING_GENERAL): BOOLEAN
 			-- Return a value, if key `a_key' exists and is boolean.
 		require
-			is_field_integer: is_boolean_field (a_key)
+			is_field_boolean: is_boolean_field (a_key)
 		do
-			if
-				attached {BOOLEAN} field_by_key (a_key) as l_value
-			then
+			if attached {BOOLEAN} field_by_key (a_key) as l_value then
 				Result := l_value
 			end
 		end
@@ -225,23 +223,19 @@ feature -- Access
 	string_field (a_key: READABLE_STRING_GENERAL): detachable STRING_32
 			-- Return a value, if key `a_key' exists and is string.
 		require
-			is_field_integer: is_string_field (a_key)
+			is_field_string: is_string_field (a_key)
 		do
-			if
-				attached {READABLE_STRING_32} field_by_key (a_key) as l_value
-			then
-				Result := l_value
+			if attached {READABLE_STRING_GENERAL} field_by_key (a_key) as l_value then
+				Result := l_value.to_string_32
 			end
 		end
 
 	object_field (a_key: READABLE_STRING_GENERAL): detachable STRING_TABLE [detachable ANY]
 			-- Return a value, if key `a_key' exists and is an object reference.
 		require
-			is_field_integer: is_object_field (a_key)
+			is_field_object: is_object_field (a_key)
 		do
-			if
-				attached {STRING_TABLE [detachable ANY]} field_by_key (a_key) as l_value
-			then
+			if attached {STRING_TABLE [detachable ANY]} field_by_key (a_key) as l_value then
 				Result := l_value
 			end
 		end
@@ -249,11 +243,9 @@ feature -- Access
 	array_field (a_key: READABLE_STRING_GENERAL): detachable ARRAY [detachable ANY]
 			-- Return a value, if key `a_key' exists and is an array reference.
 		require
-			is_field_integer: is_array_field (a_key)
+			is_field_array: is_array_field (a_key)
 		do
-			if
-				attached {ARRAY [detachable ANY]} field_by_key (a_key) as l_value
-			then
+			if attached {ARRAY [detachable ANY]} field_by_key (a_key) as l_value then
 				Result := l_value
 			end
 		end
@@ -385,7 +377,7 @@ feature -- Element Change
 
 	add_fields (key: READABLE_STRING_GENERAL; value: ANY)
 		obsolete
-			"Use `add_field` [2017-06-20]."
+			"Use `add_field` [2017-06-20]. [2017-11-31]"
 		do
 			add_field (key, value)
 		end
diff --git a/test/application.e b/test/application.e
index 9883614..d6636e5 100644
--- a/test/application.e
+++ b/test/application.e
@@ -6,10 +6,6 @@ note
 class
 	APPLICATION
 
---inherit
-
---	SHARED_EJSON
-
 create
 	make
 
@@ -18,17 +14,17 @@ feature {NONE} -- Initialization
 	make
 		do
 			create file_reader
---			test_json_min
---			test_json_hal
-----			test_json_link
---			test_hal
---			test_item_line_item
---			test_order
---			test_hal_types
---			test_example_with_nested_objects
-
-----			example_from_hal_to_domain
-----			test_build_hal_json
+			test_json_min
+			test_json_hal
+--			test_json_link
+			test_hal
+			test_item_line_item
+			test_order
+			test_hal_types
+			test_example_with_nested_objects
+
+			example_from_hal_to_domain
+			test_build_hal_json
 			test_hal_values
 		end
 
@@ -86,16 +82,16 @@ feature {NONE} -- Initialization
 		local
 			js_hal:  JSON_HAL_RESOURCE_CONVERTER
 			l_res : HAL_RESOURCE
-			l_currency : STRING
-			l_status : STRING
-			l_placed : STRING
+			l_currency : READABLE_STRING_32
+			l_status : READABLE_STRING_32
+			l_placed : READABLE_STRING_32
 		do
 			create js_hal.make
 
 			if attached json_file_from ("hal_example.json") as json_file then
 				if attached {JSON_OBJECT} json_value_from_file (json_file) as jo then
-					if attached {HAL_RESOURCE} js_hal.from_json (jo) as r then
-					    if attached {ARRAYED_LIST [HAL_RESOURCE]} r.embedded_resources_by_key ("order") as l_r then
+					if attached js_hal.from_json (jo) as r then
+					    if attached r.embedded_resources_by_key ("order") as l_r then
 							from
 								l_r.start
 							until
@@ -103,21 +99,21 @@ feature {NONE} -- Initialization
 							loop
 								l_res:= l_r.item_for_iteration
 
-					            if attached {STRING} l_res.field_by_key ("currency") as l_ucs then
+					            if attached l_res.string_field ("currency") as l_ucs then
 					            	l_currency := l_ucs
 					            	print ("Currency:" + l_currency)
 					            	io.put_new_line
 					            end
 
-					            if attached {STRING} l_res.field_by_key ("status") as l_ucs then
+					            if attached l_res.string_field ("status") as l_ucs then
 					            	l_status := l_ucs
-									print ("Status:" + l_status )
+									print ("Status:" + l_status)
 									io.put_new_line
 								end
 
-								if attached {STRING} l_res.field_by_key ("placed") as l_ucs then
+								if attached l_res.string_field ("placed") as l_ucs then
 					            	l_placed := l_ucs
-					            	print ("Placed:" + l_placed )
+					            	print ("Placed:" + l_placed)
 					            	io.put_new_line
 								end
 
@@ -180,7 +176,7 @@ feature {NONE} -- Initialization
 			line.add_item (l_item)
 			create l_item.make ("GFZ111", 1, 11)
 			line.add_item (l_item)
-			if attached {JSON_VALUE} serial.to_json (line) as jv then
+			if attached serial.to_json (line) as jv then
 				print (jv.representation)
 			end
 		end
@@ -192,7 +188,7 @@ feature {NONE} -- Initialization
 			create conv.make
 			if attached json_file_from ("hal_example.json") as json_file then
 				if attached {JSON_OBJECT} json_value_from_file (json_file) as jo then
-					if attached {HAL_RESOURCE} conv.from_json (jo) as r then
+					if attached conv.from_json (jo) as r then
 						print (r.out)
 						if attached conv.to_json (r) as jv then
 							print (jv.representation)
@@ -203,9 +199,9 @@ feature {NONE} -- Initialization
 						if attached r.links_keys as lk then
 							print (lk.out)
 						end
-						if attached r.links_by_key ("next") as ln then
+						if attached r.link_by_key ("next") as ln then
 							check
-								ln.rel ~ "next"
+								ln.rel.same_string ("next")
 							end
 						end
 					end
@@ -220,7 +216,7 @@ feature {NONE} -- Initialization
 			create conv.make
 			if attached json_file_from ("hal_example_type.json") as json_file then
 				if attached {JSON_OBJECT} json_value_from_file (json_file) as jo then
-					if attached {HAL_RESOURCE} conv.from_json (jo) as r then
+					if attached conv.from_json (jo) as r then
 						print (r.out)
 						print ("%N")
 						if attached conv.to_json (r) as jv then
@@ -238,7 +234,7 @@ feature {NONE} -- Initialization
 			create conv.make
 			if attached json_file_from ("exampleWithNestedObjects.json") as json_file then
 				if attached {JSON_OBJECT} json_value_from_file (json_file) as jo then
-					if attached {HAL_RESOURCE} conv.from_json (jo) as r then
+					if attached conv.from_json (jo) as r then
 						print (r.out)
 						print ("%N")
 						if attached conv.to_json (r) as jv then
@@ -266,17 +262,14 @@ feature {NONE} -- Initialization
 									if attached ic.item as l_item then
 										print (l_item.out)
 									end
-
 								end
 							end
 						end
-
 					end
 				end
 			end
 		end
 
-
 	test_json_hal
 			--
 		do
@@ -320,17 +313,17 @@ feature {NONE} -- Initialization
 			l_real: REAL_64
 		do
 			create l_hal.make
-			l_hal.add_field ("integer_8", {INTEGER_8}8)
+			l_hal.add_integer_field ("integer_8", {INTEGER_8} 8)
 			check is_integer_8: l_hal.is_integer_field ("integer_8") end
 			l_int := l_hal.integer_field ("integer_8")
 			print ("%Nint " + l_int.out)
 
-			l_hal.add_field ("natural_8", {NATURAL}255)
+			l_hal.add_natural_field ("natural_8", {NATURAL} 255)
 			check is_natural_8: l_hal.is_natural_field ("natural_8") end
 			l_nat := l_hal.natural_field ("natural_8")
 			print ("%Nnat " + l_nat.out)
 
-			l_hal.add_field ("real_32", {REAL}255.32)
+			l_hal.add_real_field ("real_32", {REAL} 255.32)
 			check is_real_32: l_hal.is_real_field ("real_32") end
 			l_real := l_hal.real_field ("real_32")
 			print ("%Nreal " + l_real.out)
diff --git a/test/hal_test_suite.e b/test/hal_test_suite.e
index a9543cc..b4a5048 100644
--- a/test/hal_test_suite.e
+++ b/test/hal_test_suite.e
@@ -11,6 +11,7 @@ class
 	HAL_TEST_SUITE
 
 inherit
+
 	EQA_TEST_SET
 		redefine
 			on_prepare
@@ -27,78 +28,71 @@ feature {NONE} -- Events
 feature -- Test routines
 
 	test_valid_hal_document
-    		--
+			--
 		local
-			l_res : detachable HAL_RESOURCE
+			l_res: detachable HAL_RESOURCE
 		do
 			l_res := json_to_hal ("min_hal_document.json")
-			assert("Is Valid Hal document", l_res /= Void)
+			assert ("Is Valid Hal document", l_res /= Void)
 		end
 
-
 	test_valid_hal
-    		--
+			--
 		local
-			l_res : detachable HAL_RESOURCE
+			l_res: detachable HAL_RESOURCE
 		do
 			l_res := json_to_hal ("min_hal.json")
-			assert("Not Void", l_res /= Void)
-			if attached l_res as l_r then
-				assert("Is Valid Resource", l_r.is_valid_resource)
+			assert ("Not Void", l_res /= Void)
+			if attached l_res then
+				assert ("Is Valid Resource", l_res.is_valid_resource)
 			end
 		end
 
-
 	test_empty_json
-    		--
+			--
 		local
-			l_res : detachable HAL_RESOURCE
+			l_res: detachable HAL_RESOURCE
 		do
 			l_res := json_to_hal ("empty.json")
-			assert("Not Void", l_res /= Void)
-			if attached l_res as l_r then
-				assert("Is Valid Resource", l_r.is_valid_resource)
+			assert ("Not Void", l_res /= Void)
+			if attached l_res then
+				assert ("Is Valid Resource", l_res.is_valid_resource)
 			end
 		end
 
-
 	test_self
 		local
-			l_res : detachable HAL_RESOURCE
+			l_res: detachable HAL_RESOURCE
 		do
 			l_res := json_to_hal ("min_hal.json")
-			assert("Not Void", l_res /= Void)
-			if attached l_res as ll_res then
-				if attached {HAL_LINK} ll_res.self as l_link then
-					assert ("Rel attribute is self", l_link.rel ~ "self" )
-					assert ("Has 1 element", l_link.attributes.count = 1 )
-					assert ("Has href",l_link.attributes.at (1).href ~ "http://example.com/")
+			assert ("Not Void", l_res /= Void)
+			if attached l_res then
+				if attached l_res.self as l_link then
+					assert ("Rel attribute is self", l_link.rel ~ "self")
+					assert ("Has 1 element", l_link.attributes.count = 1)
+					assert ("Has href", l_link.attributes.at (1).href.same_string ("http://example.com/"))
 				end
 			end
 		end
 
-
 	test_curies
 		local
-			l_res : detachable HAL_RESOURCE
+			l_res: detachable HAL_RESOURCE
 		do
 			l_res := json_to_hal ("curie_example.json")
-			assert("Not Void", l_res /= Void)
-			if attached l_res as ll_res then
-				if attached{HAL_LINK} ll_res.curies as l_curie then
-					assert ("Rel attribute is curies", l_curie.rel.same_string ("curies") )
-					assert ("Has 2 elements", l_curie.attributes.count = 2 )
-					assert ("Has href",l_curie.attributes.at (1).href.same_string( "https://api.example.org/{?href}"))
-					assert ("Templated",l_curie.attributes.at (1).templated)
-					assert ("Has href",l_curie.attributes.at (2).href.same_string( "https://pool-2.static.example.org/file/{?href}"))
-					assert ("Templated",l_curie.attributes.at (2).templated)
-
+			assert ("Not Void", l_res /= Void)
+			if l_res /= Void then
+				if attached l_res.curies as l_curie then
+					assert ("Rel attribute is curies", l_curie.rel.same_string ("curies"))
+					assert ("Has 2 elements", l_curie.attributes.count = 2)
+					assert ("Has href", l_curie.attributes.at (1).href.same_string ("https://api.example.org/{?href}"))
+					assert ("Templated", l_curie.attributes.at (1).templated)
+					assert ("Has href", l_curie.attributes.at (2).href.same_string ("https://pool-2.static.example.org/file/{?href}"))
+					assert ("Templated", l_curie.attributes.at (2).templated)
 				end
 			end
 		end
 
-
-
 	test_links_key
 		local
 			l_res: detachable HAL_RESOURCE
@@ -109,57 +103,52 @@ feature -- Test routines
 			if l_res /= Void then
 				l_arr := l_res.links_keys
 				l_arr.compare_objects
-				assert ("Has three elements", l_arr.count = 3 )
+				assert ("Has three elements", l_arr.count = 3)
 				assert ("Has element self", l_arr.has ("self"))
 				assert ("Has element next", l_arr.has ("next"))
 				assert ("Has element searcg", l_arr.has ("search"))
 			end
 		end
 
-
 	test_links_by_key
 		local
-			l_res : detachable HAL_RESOURCE
+			l_res: detachable HAL_RESOURCE
 		do
 			l_res := json_to_hal ("hal_example.json")
-			assert("Not Void", l_res /= Void)
+			assert ("Not Void", l_res /= Void)
 			if l_res /= Void then
-				assert ("Expected Void", l_res.links_by_key ("keynotexist") = Void)
-				if attached {HAL_LINK} l_res.links_by_key ("next") as l_link then
+				assert ("Expected Void", l_res.link_by_key ("keynotexist") = Void)
+				if attached l_res.link_by_key ("next") as l_link then
 					assert ("Expected rel : next", l_link.rel ~ "next")
 					assert ("Expected shared links 1", l_link.attributes.count = 1)
-					assert ("Expected Href value", l_link.attributes.first.href ~ "/orders?page=2" )
+					assert ("Expected Href value", l_link.attributes.first.href ~ "/orders?page=2")
 				end
 			end
 		end
 
-
-
-
 	test_embedded_resources_key
 		local
-			l_res : detachable HAL_RESOURCE
+			l_res: detachable HAL_RESOURCE
 		do
 			l_res := json_to_hal ("hal_example.json")
-			assert("Not Void", l_res /= Void)
-			if attached {HAL_RESOURCE} l_res as ll_res then
-				if attached {ARRAY[STRING]} ll_res.embedded_resources_keys as ll_arr then
-					ll_arr.compare_objects
-					assert ("Number of elements 1", ll_arr.count = 1)
-					assert ("Has element order",ll_arr.has ("order"))
+			assert ("Not Void", l_res /= Void)
+			if l_res /= Void then
+				if attached l_res.embedded_resources_keys as l_arr then
+					l_arr.compare_objects
+					assert ("Number of elements 1", l_arr.count = 1)
+					assert ("Has element order", l_arr.has ("order"))
 				end
 			end
 		end
 
-
 	test_embedded_resource_by_key
 		local
-			l_res : detachable HAL_RESOURCE
+			l_res: detachable HAL_RESOURCE
 		do
 			l_res := json_to_hal ("hal_example.json")
-			assert("Not Void", l_res /= Void)
-			if attached {HAL_RESOURCE} l_res as ll_res then
-				if attached {LIST[HAL_RESOURCE]} ll_res.embedded_resources_by_key ("order") as l_list then
+			assert ("Not Void", l_res /= Void)
+			if l_res /= Void then
+				if attached l_res.embedded_resources_by_key ("order") as l_list then
 					l_list.compare_objects
 					assert ("Number of elements 2", l_list.count = 2)
 				end
@@ -168,56 +157,56 @@ feature -- Test routines
 
 	test_fields_keys
 		local
-			l_res : detachable HAL_RESOURCE
+			l_res: detachable HAL_RESOURCE
 		do
 			l_res := json_to_hal ("hal_multi_links.json")
-			assert("Not Void", l_res /= Void)
-			if attached {HAL_RESOURCE} l_res as ll_res then
-				if attached {ARRAY [STRING]} ll_res.fields_keys as l_arr then
+			assert ("Not Void", l_res /= Void)
+			if l_res /= Void then
+				if attached l_res.fields_keys as l_arr then
 					l_arr.compare_objects
 					assert ("Number of elements 2", l_arr.count = 2)
-					assert ("Expected name ", l_arr[1] ~ "name")
-					assert ("Expected weight ", l_arr[2] ~ "weight")
+					assert ("Expected name ", l_arr [1].same_string ("name"))
+					assert ("Expected weight ", l_arr [2].same_string ("weight"))
 				end
 			end
 		end
 
 	test_fields_by_key
 		local
-			l_res : detachable HAL_RESOURCE
+			l_res: detachable HAL_RESOURCE
 		do
 			l_res := json_to_hal ("hal_multi_links.json")
-			assert("Not Void", l_res /= Void)
-			if attached {HAL_RESOURCE} l_res as ll_res then
-				if attached {STRING_32} ll_res.field_by_key ("name") as l_str then
-					assert ("Expected Value: A product", l_str.is_equal ("A product"))
+			assert ("Not Void", l_res /= Void)
+			if l_res /= Void then
+				if attached l_res.string_field ("name") as l_str then
+					assert ("Expected Value: A product", l_str.same_string ("A product"))
 				end
-				if attached {STRING_32} ll_res.field_by_key ("weight") as l_str then
-					assert ("Expected Value: A product", l_str.is_equal ("400"))
+				if attached l_res.integer_field ("weight") as l_int then
+					assert ("Expected Value: A product", l_int = 400)
 				end
 			end
 		end
 
 	test_link_template
 		local
-				l_res : detachable HAL_RESOURCE
-			do
-				l_res := json_to_hal ("example_template.json")
-				assert("Not Void", l_res /= Void)
-				if attached{HAL_RESOURCE} l_res as ll_res then
-					assert ("Expected Void",ll_res.links_by_key ("keynotexist") = Void)
-					if attached {HAL_LINK} ll_res.links_by_key ("find") as ll_link then
-						assert ("Expected rel : next", ll_link.rel.same_string ("find"))
-						assert ("Expected shared links 1", ll_link.attributes.count = 1)
-						assert ("Expected templated : true", ll_link.attributes.at (1).templated = True)
-						assert ("Expected Href value", ll_link.attributes.at (1).href.same_string ( "/orders{?id}") )
-					end
+			l_res: detachable HAL_RESOURCE
+		do
+			l_res := json_to_hal ("example_template.json")
+			assert ("Not Void", l_res /= Void)
+			if l_res /= Void then
+				assert ("Expected Void", l_res.link_by_key ("keynotexist") = Void)
+				if attached l_res.link_by_key ("find") as l_link then
+					assert ("Expected rel : next", l_link.rel.same_string ("find"))
+					assert ("Expected shared links 1", l_link.attributes.count = 1)
+					assert ("Expected templated : true", l_link.attributes.at (1).templated = True)
+					assert ("Expected Href value", l_link.attributes.at (1).href.same_string ("/orders{?id}"))
+				end
 			end
 		end
 
 feature {NONE} -- Implementation
 
-	hal_to_json ( a_res : HAL_RESOURCE) : detachable JSON_VALUE
+	hal_to_json (a_res: HAL_RESOURCE): detachable JSON_VALUE
 		local
 			conv: JSON_HAL_RESOURCE_CONVERTER
 		do
@@ -225,7 +214,7 @@ feature {NONE} -- Implementation
 			Result := conv.to_json (a_res)
 		end
 
-	json_to_hal (fn : STRING) : detachable HAL_RESOURCE
+	json_to_hal (fn: STRING): detachable HAL_RESOURCE
 		local
 			jp: like new_json_parser
 			conv: JSON_HAL_RESOURCE_CONVERTER
@@ -246,7 +235,7 @@ feature {NONE} -- Implementation
 
 	file_reader: JSON_FILE_READER
 
-   	json_file_from (fn: STRING): detachable STRING
+	json_file_from (fn: STRING): detachable STRING
 		do
 			Result := file_reader.read_json_from (fn)
 			assert ("File contains json data", Result /= Void)
@@ -265,30 +254,10 @@ feature {NONE} -- Implementation
 		do
 			p := new_json_parser (json_file)
 			p.parse_content
-			check json_is_parsed: p.is_parsed end
-			Result := p.parsed_json_value
-		end
-
-	test_dir: STRING_32
-		local
-			i: INTEGER
-		do
-			Result := (create {EXECUTION_ENVIRONMENT}).current_working_path.name
-			Result.append_character ((create {OPERATING_ENVIRONMENT}).directory_separator)
-				-- The should looks like
-				-- ..json\test\autotest\test_suite\EIFGENs\test_suite\Testing\execution\TEST_JSON_SUITE.test_json_fail1\..\..\..\..\..\fail1.json
-			from
-				i := 5
-			until
-				i = 0
-			loop
-				Result.append_character ('.')
-				Result.append_character ('.')
-				Result.append_character ((create {OPERATING_ENVIRONMENT}).directory_separator)
-				i := i - 1
+			check
+				json_is_parsed: p.is_parsed
 			end
+			Result := p.parsed_json_value
 		end
 
 end
-
-
diff --git a/test/test_suite.ecf b/test/test_suite.ecf
index c49157e..e5812fb 100644
--- a/test/test_suite.ecf
+++ b/test/test_suite.ecf
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="test" uuid="68E0C364-BA4A-4472-B21F-ADB370B0426F">
-	<target name="test_suite">
+<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="test_hal" uuid="642149F5-681B-4A98-9811-64958371A3D3">
+	<target name="test_hal">
 		<root cluster="test" class="APPLICATION" feature="make"/>
 		<file_rule>
 			<exclude>/.svn$</exclude>

From 6b912b836b9ce59e19def49793c7fc8f5ace98bc Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Mon, 8 Jan 2018 13:54:00 -0300
Subject: [PATCH 45/47] Update HAL library. For embedded resources we always
 generate an array, so with this we remove the distinction between 1 or more
 embedded resources as we alwats use an array or resources.

---
 .../converter/hal_resource_json_serializer.e  | 18 +++----
 test/application.e                            | 49 +++++++++++++++++++
 test/exampleWithSubResource.json              | 39 +++++++++++++++
 test/hal_test_suite.e                         | 14 ++++++
 4 files changed, 109 insertions(+), 11 deletions(-)
 create mode 100644 test/exampleWithSubResource.json

diff --git a/library/converter/hal_resource_json_serializer.e b/library/converter/hal_resource_json_serializer.e
index f2d5357..7e1baf3 100644
--- a/library/converter/hal_resource_json_serializer.e
+++ b/library/converter/hal_resource_json_serializer.e
@@ -54,19 +54,15 @@ feature {NONE} -- Converter implementation
 		local
 			l_result_arr: JSON_ARRAY
 		do
-			if a_resource.count = 1 then
-				Result := to_json (a_resource.first, ctx)
-			else
-				create {JSON_ARRAY} l_result_arr.make_empty
-				across
-					a_resource as ic
-				loop
-					if attached to_json (ic.item, ctx) as l_iter then
-						l_result_arr.add (l_iter)
-					end
+			create {JSON_ARRAY} l_result_arr.make_empty
+			across
+				a_resource as ic
+			loop
+				if attached to_json (ic.item, ctx) as l_iter then
+					l_result_arr.add (l_iter)
 				end
-				Result := l_result_arr
 			end
+			Result := l_result_arr
 		end
 
 	to_json_links (a_links: TABLE_ITERABLE [HAL_LINK, READABLE_STRING_GENERAL]; ctx: JSON_SERIALIZER_CONTEXT): JSON_OBJECT
diff --git a/test/application.e b/test/application.e
index d6636e5..d566218 100644
--- a/test/application.e
+++ b/test/application.e
@@ -23,6 +23,8 @@ feature {NONE} -- Initialization
 			test_hal_types
 			test_example_with_nested_objects
 
+			test_embedded_hal_json
+
 			example_from_hal_to_domain
 			test_build_hal_json
 			test_hal_values
@@ -63,6 +65,53 @@ feature {NONE} -- Initialization
 			end
 		end
 
+
+	test_embedded_hal_json
+		local
+			conv: JSON_HAL_RESOURCE_CONVERTER
+			l_res: HAL_RESOURCE
+			l_link: HAL_LINK
+			l_attribute: HAL_LINK_ATTRIBUTE
+			l_items: HAL_RESOURCE
+			l_list: LIST [HAL_RESOURCE]
+		do
+			create conv.make
+			create l_attribute.make ("/orders?{id}")
+			l_attribute.set_name ("orders")
+
+			create l_res.make
+			l_res.add_curie_link (l_attribute)
+
+			create l_attribute.make ("/")
+			create l_link.make_with_attribute ("self",l_attribute )
+			l_res.add_link (l_link)
+
+			create l_attribute.make ("/pages/?{page}")
+			l_attribute.set_name ("pages")
+			create l_link.make_with_attribute ("curies",l_attribute)
+			l_res.add_link (l_link)
+
+
+			create l_items.make
+			l_items.add_integer_field ("product_id", 1)
+			l_items.add_integer_field ("count", 1)
+			create {ARRAYED_LIST[HAL_RESOURCE]} l_list.make (1)
+			l_list.force (l_items)
+			l_res.add_embedded_resources_with_key ("items", l_list)
+
+			print ("%Nis_valid_resource:" + l_res.is_valid_resource.out )
+			io.put_new_line
+			if attached conv.to_json (l_res) as j then
+				print (j.representation)
+
+				if attached conv.from_json (j) as hal then
+					print (hal)
+					print (friendly_output (hal))
+				end
+			end
+		end
+
+
 	friendly_output (obj: detachable ANY): STRING
 		local
 			serial: JSON_REFLECTOR_SERIALIZER
diff --git a/test/exampleWithSubResource.json b/test/exampleWithSubResource.json
new file mode 100644
index 0000000..5b48b8b
--- /dev/null
+++ b/test/exampleWithSubResource.json
@@ -0,0 +1,39 @@
+{
+  "_links" : {
+    "curies" : [ {
+      "href" : "https://example.com/apidocs/ns/{rel}",
+      "name" : "ns",
+      "templated" : true
+    }, {
+      "href" : "https://example.com/apidocs/role/{rel}",
+      "name" : "role",
+      "templated" : true
+    } ],
+    "self" : {
+      "href" : "https://example.com/api/customer/123456"
+    },
+    "ns:parent" : {
+      "href" : "https://example.com/api/customer/1234",
+      "name" : "bob",
+      "title" : "The Parent",
+      "hreflang" : "en"
+    },
+    "ns:users" : {
+      "href" : "https://example.com/api/customer/123456?users"
+    }
+  },
+  "_embedded" : {
+    "ns:user" : {
+      "_links" : {
+        "self" : {
+          "href" : "https://example.com/user/11"
+        }
+      },
+      "age" : 32,
+      "expired" : false,
+      "id" : 11,
+      "name" : "Example User",
+      "optional" : true
+    }
+  }
+}
diff --git a/test/hal_test_suite.e b/test/hal_test_suite.e
index b4a5048..ebb6fc4 100644
--- a/test/hal_test_suite.e
+++ b/test/hal_test_suite.e
@@ -155,6 +155,20 @@ feature -- Test routines
 			end
 		end
 
+	test_embedded_resource_by_key_array
+		local
+			l_res: detachable HAL_RESOURCE
+		do
+			l_res := json_to_hal ("exampleWithSubResource.json")
+			assert ("Not Void", l_res /= Void)
+			if l_res /= Void then
+				if attached l_res.embedded_resources_by_key ("ns:user") as l_list then
+					l_list.compare_objects
+					assert ("Number of elements 1", l_list.count = 1)
+				end
+			end
+		end
+
 	test_fields_keys
 		local
 			l_res: detachable HAL_RESOURCE

From 46e19d9e422b0009721c9708edd4d4230256283b Mon Sep 17 00:00:00 2001
From: jvelilla <javier.hector@gmail.com>
Date: Mon, 8 Jan 2018 14:44:23 -0300
Subject: [PATCH 46/47] Updated Readme file.

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 869916d..d74ad56 100644
--- a/README.md
+++ b/README.md
@@ -7,5 +7,5 @@ HAL is used for exposing RESTful hypermedia APIs. Right now the current implemen
 JSON_HAL
 
 References
-http://tools.ietf.org/html/draft-kelly-json-hal-07
+http://tools.ietf.org/html/draft-kelly-json-hal-08
 http://stateless.co/hal_specification.html#json

From 90625b868fdf203d6c53e48303c6c65418e4f947 Mon Sep 17 00:00:00 2001
From: Jocelyn Fiat <github@djoce.net>
Date: Mon, 8 Jan 2018 20:56:58 +0100
Subject: [PATCH 47/47] Updated CI configurations to use latest release (for
 now 17.05).

---
 .appveyor.yml | 4 ++--
 .travis.yml   | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/.appveyor.yml b/.appveyor.yml
index 0b97644..9b5fc0a 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -18,12 +18,12 @@ install:
   - mkdir C:\projects\eiffel
   - cd C:\projects\eiffel
 
-  - set EIFFELSTUDIO_URL="https://ftp.eiffel.com/pub/beta/nightly/Eiffel_17.11_gpl_100607-win64.7z"
+  - set EIFFELSTUDIO_URL="https://ftp.eiffel.com/pub/download/17.05/Eiffel_17.05_gpl_100416-win64.7z"
   - appveyor DownloadFile %EIFFELSTUDIO_URL% -FileName eiffel_studio.zip
   - 7z x eiffel_studio.zip -oC:\projects\eiffel\ > nul
   - cmd: set ISE_C_COMPILER=msc_vc140
   - cmd: set ISE_PLATFORM=win64
-  - cmd: set ISE_EIFFEL=C:\projects\eiffel\Eiffel_17.11 
+  - cmd: set ISE_EIFFEL=C:\projects\eiffel\Eiffel_17.05 
   - cmd: set PATH=%PATH%;%ISE_EIFFEL%/studio/spec/%ISE_PLATFORM%/bin;
   - cmd: set PATH=%PATH%;%ISE_EIFFEL%/tools/spec/%ISE_PLATFORM%/bin;
   - ec -version
diff --git a/.travis.yml b/.travis.yml
index 3ad422e..2afd697 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,10 +1,9 @@
 language: eiffel
 before_script:
   - export current_dir=$PWD ; echo current_dir=$current_dir ; cd ..
-  - export ISE_EIFFEL=$PWD/Eiffel_17.11; 
   - export ISE_PLATFORM=linux-x86-64
-  - curl -sSL https://ftp.eiffel.com/pub/beta/nightly/Eiffel_17.11_gpl_100608-linux-x86-64.tar.bz2 | tar -x --bzip2
-  - export PATH=$PATH:$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin:$PATH:$ISE_EIFFEL/tools/spec/$ISE_PLATFORM/bin
+  - curl -sSL https://www.eiffel.org/setup/install.sh | bash > eiffel.rc
+  - source ./eiffel.rc
   - echo `ec -version`
   - cd $current_dir
 
@@ -12,6 +11,7 @@ before_script:
 branches:
   only:
   - master
+  - develop
 
 script: 
   #compile code  
