pksunkara / alpaca

Given a web API, Generate client libraries in node, php, python, ruby
Mozilla Public License 2.0
2.45k stars 89 forks source link

Force custom URL for API #29

Closed matrixik closed 10 years ago

matrixik commented 10 years ago

I would like to create libraries for database ArangoDB (and at future for Wordpress) but it is self hosted and don't have one, static API URL.

Could you add method to generated libraries, so that programmers are forced to initialize API client with custom URL? Like:

class Client(object):
    def __init__(self, base_url, auth={}, options={}):
        self.http_client = HttpClient(base_url, auth, options)
pksunkara commented 10 years ago

If you check here, you can see that people who use the library have to option to replace the base_url. Just provide a default url and write in your README to use that option.

matrixik commented 10 years ago

I know about that, but I would prefer to force it on library level (less error prone).

pksunkara commented 10 years ago

Fixed by #30