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

Formatting flags are not working for single endpoints #47

Open
MushroomMaula opened this issue Apr 10, 2019 · 1 comment
Open

Formatting flags are not working for single endpoints #47

MushroomMaula opened this issue Apr 10, 2019 · 1 comment

Comments

@MushroomMaula
Copy link

MushroomMaula commented Apr 10, 2019

Formatting flags like hyphenate are only working when the formatter is set on the base Wrapper

base = tortilla.wrap('api.example.org', hyphenate=True)
base.hyphenated_endpoint  # GET api.example.org/hyphenated-endpoint

# however
base = tortilla.wrap('api.example.org')
base.hyphenated_endpoint(hyphenate=True)  # GET api.exaple.org/hyphenated_endpoint
base('hyphenated_endpoint', hyphenate=True)  # same result

I think it would be a good idea to add support of formatting options to single endpoints as well.

@MushroomMaula
Copy link
Author

When creating new children objects as it's own varibale the formatters are also not working even when the formatter has been set on the base. The issue here is that the formatter in the config is not set on the child by the parent

base = tortilla.wrap('api.example.org', hyphenate=True)
base.hyphenated_endpoint  # GET api.example.org/hyphenated-endpoint

endpoint = base.('extra/endpoint')
endpoint.hyphenated_endpoint # GET api.example.org/extra/endpoint/hyphenated_endpoint

print(endpoint.config.formatter) # None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant