zf-fr / zfr-rest

A module for Zend Framework 2 that aims to simplify RESTful
81 stars 31 forks source link

Support versioning #94

Open bakura10 opened 10 years ago

bakura10 commented 10 years ago

Just an idea for myself for potential mapping for versioning:

Currently, mapping is defined using Resource and Collection annotations:

/**
 * @REST\Resource(controller="MyController")
 * @REST\Collection(controller="MyCollectionController")
 */
class Resource

The idea is to simply add a "mediaVersion" parameter that would be used during content negotiation:

/**
 * @REST\Resource(mediaVersion="application/vnd.v1+json", controller="MyController")
 * @REST\Resource(mediaVersion="application/vnd.v2+json", controller="MyControllerV2")
 */
class Resource
Ocramius commented 10 years ago

@bakura10 still confusing IMO. So you'd support versions only via content negotiation?

bakura10 commented 10 years ago

I agree, that was a bad idea. As you said, if we should support versioning it should be a complete cloning of the project inside a new namespace.