Skip to content

Version numbering #16

Closed
Closed
@sestolk

Description

@sestolk

I seem to be running into a problem of which I dont know if I'm doing something wrong or it is some sort of restriction.

I am currently testing your API to see if it fulfills the requirements for a project I will be working on. For this project I would like version numbers that use 3 digits (length), for example: 0.0.1, 1.0.3 etc.

When I create the API groups with simple digits v1, v2, v3 it works fine, but when I start to use v1.1.0 (also tried only 2 digits) or v110 it will always default back to v1.

So this works:

Route::api(['version' => 'v1', 'namespace' => 'v001'], function()
{ ... });
Route::api(['version' => 'v2', 'namespace' => 'v002'], function()
{ ... });
Route::api(['version' => 'v3', 'namespace' => 'v003'], function()
{ ... });

But when I change it to:

Route::api(['version' => 'v1', 'namespace' => 'v001'], function()
{ ... });
// v11 or v1.1 or v1.1.0 tried several combinations
Route::api(['version' => 'v11', 'namespace' => 'v011'], function()
{ ... });
Route::api(['version' => 'v3', 'namespace' => 'v003'], function()
{ ... });

It will always default back to v1 as if the version is not properly translated.

I used Postman to test the endpoints with the following Accept header:

application/vnd.test.v1.1+json
// or
application/vnd.test.v11+json
// or
application/vnd.test.v1.1.0+json

'test' is configured in the config.php

Could you tell me what I am doing wrong? If anything is unclear, please let me know!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions