Commit d9eabcd7 authored by Bruno Nocera Zanette's avatar Bruno Nocera Zanette

fix SchemaRegistry endpoints

parent 4b5a851d
......@@ -36,7 +36,9 @@ module Dspace
action :create_schema,
'POST /rest/registries/schema' do
body { |object| JSON.generate(object.to_h) }
handler(200) { |response| response.inspect }
handler(200) do |response|
Dspace::SchemaRegistry.new(JSON.parse(response.body))
end
end
# DELETE /registries/schema/{schema_id}
......@@ -69,11 +71,9 @@ module Dspace
# PUT /registries/metadata-fields/{field_id}
# => Update the specified metadata field
action :update_metadata_field,
'GET /rest/registries/metadata-fields/:field_id' do
query_keys :expand
handler(200) do |response|
Dspace::Field.new(JSON.parse(response.body))
end
'PUT /rest/registries/metadata-fields/:field_id' do
body { |object| JSON.generate(object.to_h) }
handler(200) { |response| true }
end
# DELETE /registries/metadata-fields/{field_id}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment