- Allow Representable
>= 3.1
- Replace
Virtus
withDry-Types
- Allow Representable 3.x.
- Require Representable 3.0.x
- Remove CollectionJSON support until we get more feedback.
- Move JSON API support (
Roar::JSON::JSONAPI
) to the separate roar-jsonapi gem. - When using
links[]
, you now need to provide the string name, as indecorator.links["self"]
. Symbols are not supported, anymore. ::links
now accepts a String or Symbol as its first argument, enabling more straight-forward definition of CURIE links: e.g.links 'doc:link_collection' do; end
(@edejong).- Clients can now parse lonely collections. (@hilary)
- Require Representable < 2.4.
- Make
:as
work withHAL
.
- Roar runs on Rubinius.
"_embedded"
will always be rendered before"_links"
.render_nil: false
is now respected.
- Allow calling
::has_one
,::links
and::has_many
in any order in JSON API. This requires Representable >= 2.1.4.
- Removed
Representer
andFeature
namespace. That means changes along the following.Roar::Representer::Feature::Hypermedia
-->Roar::Hypermedia
Roar::Representer::JSON
-->Roar::JSON
- Removed positional arguments for
HttpVerbs#get
and friends. HttpVerbs#get
and friends will now raise an exception when the response code is not 2xx. You can get the original response viaRoar::Transport::Error#response
. Thanks to @paulccarey for all his inspiring work and patience!
Roar::JSON::JSONAPI
supports JSON API. A big thanks to @oliverbarnes for his continuous help, support and research on how to implement this standard.
Hyperlink#to_hash
now returns stringified keys.- Removed
Representer#before_serialize
hook. Override#serialize
yourself. Represented#links
now returnsnil
when no parsing has happened.- Removed class methods
::from_json
,::from_hash
,::from_xml
and::deserialize
. Please build the instance yourself and use something alongSong.new.from_json
.
- Remove the concept of
links_array
.Hyperlink
instances for rendering or that have been parsed are always stored in aLinkCollection
that is available via#links
. Hypermedia
is now 43% simpler.HyperlinkCollection#each
now has different semantics for 1- or 2-arity.
- Last release to support Representable < 2.0.
- Bug fix where hypermedia links were wrong when invoking serialization multiple times on the same instance.
- Remove deprecations (most of 'em) from Representable 1.8. Sorry for that.
- Roar runs with Representable <= 1.8.
- The
HAL
module supports CURIE links now using the::curie
method. - Allow old and new API in HttpVerbs#get and friends.
- Allow basic authentication with
basic_auth: [:admin, :password]
. - Allow HTTPS.
- Removed
NetHTTP#do_request
. It is inNetHTTP::Request
now.
- They now yield the request object to add headers etc before request is sent.
- They NO LONGER support positional arguments but one hash with
uri: "https://roar.de", body:, .. as: ..
and so on.
- Fix a bug where hyperlinks from nested objects weren't rendered in XML.
Allow Representable >= 1.6.
- Updating to Representable 1.5.2.
- Fixing HAL + Decorator.
- Requiring Representable 1.5.0.
- Added
Roar::Decorator::HypermediaConsumer
which propagates incoming hypermedia links to the represented object (it has to have accessors for:links
).
- Fixing #66.
- Fixing
Gemfile
.
- Adding
Roar::Decorator
, see Representable docs for now.
- Moved
::inheritable_array
fromHypermedia
toRepresenter
.
- Allow use of
::link(string)
.
- Fix a syntax error for Ruby 1.8.
- Store link definitions in
Representable_attrs(:links)
now and no longer in theLinksDefinition
instance itself. removing#links_definition
in favor of#link_configs
.
- When using
Feature::Client
hyperlinks are no longer rendered in POST and PUT since we passlinks: false
. Transport::NetHttp
now sets bothAccept:
andContent-type:
header since Rails services seems to get confused.
- Fixed
JSON::HAL::Links
so that it keys links withlinks
and not_links
. The latter is still done byJSON::HAL
.
- Maintenance release: Fixing the horrible bug fix from 0.11.6 and make it a bit less horrible.
- "Fixing" a bug where
links_definition_option
was missing when no link was set in a representer. Note that this is a quick and horrible bugfix and will soon be cleaned up.
- Introducing
HAL::links
method to map arrays of link objects in the HAL format. This completes the HAL/JSON specification.
- Links can now return a hash of attributes as
link :self do {:href => fruit_path(self), :title => "Yummy stuff"} end
.
- Fixed an installation issue under Windows.
- The request body in POST, PUT and PATCH is now actually sent in HttpVerbs. Thanks to @nleguen for finding this embarrassing bug. That's what happens when you don't have proper tests, kids!
- Since some users don't have access to my local hard-drive we now really require Representable 1.2.2.
-
Using Representable 1.2.2 now. Be warned that in 1.2 parsing and rendering slightly changed. When a property is not found in the incoming document, it is ignored and thus might not be initialised in your represented model (empty collections are still set to an empty array). Also, the way
false
andnil
values are rendered changed.Quoted from the Representable CHANGES file:
- A property with false value will now be included in the rendered representation. Same applies to parsing, false values will now be included. That particularly means properties that used to be unset (i.e. nil) after parsing might be false now.
- You can include nil values now in your representations since #property respects
:represent_nil => true
.
-
The
:except
option was deprecated in favor of:exclude
. -
Hyperlinks can now have arbitrary attributes. To render, just provide
#link
with the optionslink :self, :title => "Mee!", "data-remote" => true
When parsing, the options are available via
OpenStruct
compliant readers.link = Hyperlink.from_json('{"rel":"self","data-url":"http://self"'}) link.rel #=> "self" link.send("data-url") #=> "http://self"
- You can now pass values from outside to the render method (e.g.
#to_json
), they will be available as block parameters inside#link
.
- Adding the Coercion feature.
- Requiring Representable 0.1.3.
- Added JSON-HAL support.
- Links are no longer rendered when
href
isnil
orfalse
. Representer.link
class method now accepts either therel
value, only, or a hash of link attributes (defined inHypermedia::Hyperlink.params
), likelink :rel => :self, :title => "You're good" do..
- API CHANGE:
Representer#links
no longer returns thehref
value but the link object. Use it likeobject.links[:self].href
to retrieve the URL. #from_json
won't throw an exception anymore when passed an empty json document.
- Using Representable 1.1.
- Removed
Representer#to_attributes
and#from_attributes
. - Using Representable 1.0.1 now.
- Using Representable 0.12.x.
Representer::Base
is now simplyRepresenter
.- Removed all the class methods from
HttpVerbs
except forget
.
- Maintenance release for Representable compat.
- Removing
restfulie
dependency - we now useNet::HTTP
.
- Added the
:except
and:include
options to#from_*
.