All,
Just a quick note to let you know that we've released a new version of Praxis: 0.15.0
This was a quicker cycle than usual but we wanted to fix a bug that made using the praxis binary fail when creating a new project, something especially bad for somebody getting started with Praxis.
Other than a bunch of bug fixes an enhancements, we now have the first cut at a pluggable content-type management!
- Responses will now automatically encode the outgoing bodies based on the response content-type the application sets. This makes it very easy to work with hash/array representation of objects within the app, and forget the final encoding that will go out to the wire. Obviously, if the app can fully control the encoding by continuing to pass a String body in a response (rather than a Hash/Array).
- Request bodies will be properly decoded based on the handler registered for the specified Content-Type. Currently only form-encoding and JSON were supported.
- Handlers are pluggable, so it is very easy to build and register new ones to decode/encode different payloads. Praxis comes with handlers for JSON (default), URL-form-encoding and XML(ActiveSupport format).
Here is the snippet from the Changelog:
- Fixed handling of no app or design file groups defined in application layout.
- Handled and added warning message for doc generation task when no routing block is defined for an action.
- Improved
link
method in MediaType
attribute definition to support inheriting the type from the :using
option if if that specifies an attribute. For example: link :posts, using: :posts_summary
would use the type of the:posts_summary
attribute. - Fixed generated
Links
accessors to properly load the returned value. - Added
MediaTypeIdentifier
class to parse and manipulate Content-Type headers and Praxis::MediaType identifiers. - Created a registry for media type handlers that parse and generate document bodies with formats other than JSON.
- Given a structured-data response, Praxis will convert it to JSON, XML or other formats based on the handler indicated by its Content-Type.
- Given a request, Praxis will use the handler indicated by its Content-Type header to parse the body into structured data.
- Fixed bug allowing "praxis new" to work when Praxis is installed as a system (non-bundled) gem.
- Fixed doc generation code for custom types
- Hardened Multipart type loading
Cheers and happy Praxing!
Josep M.