Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to omit api version from url #16

Closed
JanMikes opened this Issue Apr 16, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@JanMikes
Copy link
Contributor

JanMikes commented Apr 16, 2018

We are implementing oauth2 server and it does not make much sense to version this api.

Instead of /oauth2/1.0/access-token i would like to have url /oauth2/acces-token.

Imagine this config:

parameters:
	api:
		routes:
			oauth2:
				null:
					"/access-token":
						post:
							service: xxx
							middleware: []

Though this would break URL generation with double slash and final url would be /oauth2//access-token due to https://github.com/BrandEmbassy/slim-nette-extension/blob/master/src/SlimApplicationFactory.php#L232

If you agree and it makes sense for you, i can send a PR

@JanMikes

This comment has been minimized.

Copy link
Contributor Author

JanMikes commented Apr 16, 2018

Actually this config is working:

oauth2:
		"":
			"authorize":
				get:
					service: App\API\Service\AuthorizeUserAction
					middleware: []

Just the leading / has to be omited, which could be easily "fixed".

@Achse

This comment has been minimized.

Copy link
Contributor

Achse commented May 10, 2018

I would say that solution with "" is fine. If you have some proposal how to solve it in the better way feel free to draft it in PR.

Maybe using some regexp replace for \/{2,} -> / at https://github.com/BrandEmbassy/slim-nette-extension/blob/master/src/SlimApplicationFactory.php#L232 would be another option.

@Achse Achse closed this May 10, 2018

@Achse

This comment has been minimized.

Copy link
Contributor

Achse commented Mar 4, 2019

We are trying to use slim for non-(rest)-api request and we need to solve this.

@Achse Achse reopened this Mar 4, 2019

Achse added a commit that referenced this issue Mar 4, 2019

Achse added a commit that referenced this issue Mar 4, 2019

@Achse Achse closed this in b3bf27d Mar 5, 2019

Achse added a commit that referenced this issue Mar 5, 2019

Merge pull request #26 from BrandEmbassy/fix_double_slashes
Solving double-slashes in routing when omitting, closes #16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.