Updated code to remove obsolete call on recent version of json library.

Updated upload_image example to use PATH instead of DIRECTORY_NAME or similar.
Removed unused local variables.
This commit is contained in:
2015-04-07 19:27:30 +02:00
parent b7a12eddaf
commit 881625a0f6
25 changed files with 131 additions and 112 deletions
@@ -97,7 +97,7 @@ feature -- Conversion
Result.put (json.value (o.location), location_key)
Result.put (json.value (o.status), status_key)
from
create ja.make_array
create ja.make_empty
o.items.start
until
o.items.after
@@ -117,48 +117,48 @@ feature -- Conversion
feature {NONE} -- Implementation
id_key: JSON_STRING
once
create Result.make_json ("id")
create Result.make_from_string ("id")
end
location_key: JSON_STRING
once
create Result.make_json ("location")
create Result.make_from_string ("location")
end
status_key: JSON_STRING
once
create Result.make_json ("status")
create Result.make_from_string ("status")
end
items_key : JSON_STRING
once
create Result.make_json ("items")
create Result.make_from_string ("items")
end
name_key : JSON_STRING
once
create Result.make_json ("name")
create Result.make_from_string ("name")
end
size_key : JSON_STRING
once
create Result.make_json ("size")
create Result.make_from_string ("size")
end
quantity_key : JSON_STRING
once
create Result.make_json ("quantity")
create Result.make_from_string ("quantity")
end
option_key : JSON_STRING
once
create Result.make_json ("option")
create Result.make_from_string ("option")
end
feature -- Validation
@@ -171,6 +171,6 @@ feature -- Validation
end
note
copyright: "2011-2012, Javier Velilla and others"
copyright: "2011-2015, Javier Velilla and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end
@@ -559,8 +559,9 @@ feature {NONE} -- Implementation Repository Layer
do
create joc.make
json.add_converter(joc)
create parser.make_parser (l_post)
if attached parser.parse as jv and parser.is_parsed then
create parser.make_with_string (l_post)
parser.parse_content
if parser.is_valid and then attached parser.parsed_json_value as jv then
if attached {like extract_order_request} json.object (jv, "ORDER") as res then
Result := res
end
@@ -568,6 +569,6 @@ feature {NONE} -- Implementation Repository Layer
end
note
copyright: "2011-2014, Javier Velilla and others"
copyright: "2011-2015, Javier Velilla and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end
@@ -385,8 +385,12 @@ feature {NONE} -- Implementation Repository Layer
do
create joc.make
json.add_converter(joc)
create parser.make_parser (l_post)
if attached parser.parse as jv and parser.is_parsed then
create parser.make_with_string (l_post)
parser.parse_content
if
parser.is_valid and then
attached parser.parsed_json_value as jv
then
if attached {like extract_order_request} json.object (jv, "ORDER") as res then
Result := res
end
@@ -394,6 +398,6 @@ feature {NONE} -- Implementation Repository Layer
end
note
copyright: "2011-2013, Javier Velilla and others"
copyright: "2011-2015, Javier Velilla and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end