zfcampus / zf-versioning

BSD 3-Clause "New" or "Revised" License
11 stars 7 forks source link

Allowing for configurable default version #1

Closed michaelmoussa closed 10 years ago

michaelmoussa commented 10 years ago

This change allows the API developer to choose which version should act as the default if none is specified in the URL or headers.

This is accomplished by setting [zf-versioning][default-version] in module.config.php (which defaults to 1). If this setting is omitted, then the existing default value of 1 in the PrototypeRouteListener will be used.

I modified the dataProvider in the test class to provide an optional $apiVersion to allow for testing various possibilities, such as:

weierophinney commented 10 years ago

@michaelmoussa Can you also do a similar PR against zfcampus/zf-apigility-admin for setting a default per-API?

michaelmoussa commented 10 years ago

@weierophinney Sure.

Is there anything else needed for this particular PR against zf-versioning so I can tackle that too? I started the zf-apigility-admin work already and so far haven't seen any updates that I would need to make to this PR.

michaelmoussa commented 10 years ago

@weierophinney WIP for zf-apigility-admin here if you're interested and want to comment.

It updates the configuration file already and everything. I just need to have the new default version value persist on the admin frontend between refreshes. That information is not presently available in the /admin/api/module response.

weierophinney commented 10 years ago

Looking good -- can you rebase your zf-apigility-admin changes against most recent master, please, and then submit a PR for it? I'll go ahead and merge this one, with the changes I suggested, in the meantime.

michaelmoussa commented 10 years ago

Sure. Will take care of it late next week. Thanks for the merge.