module Croods::Resource::JsonSchema::Links::Update
Public Class Methods
link(resource)
click to toggle source
# File lib/croods/resource/json_schema/links/update.rb, line 9 def link(resource) { href: resource.member_path, method: 'PUT', rel: 'self', schema: schema(resource), targetSchema: target_schema(resource) } end
schema(resource)
click to toggle source
# File lib/croods/resource/json_schema/links/update.rb, line 19 def schema(resource) { additionalProperties: false, properties: Properties.schema(resource, request: true), type: ['object'] } end
target_schema(resource)
click to toggle source
# File lib/croods/resource/json_schema/links/update.rb, line 27 def target_schema(resource) { anyOf: [ resource.ref, { '$ref': '#/definitions/error' } ] } end