Skip to content

PHP Namespace Is Not API-Specific #974

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

Closed
andrewmunsell opened this issue Jul 11, 2015 · 4 comments
Closed

PHP Namespace Is Not API-Specific #974

andrewmunsell opened this issue Jul 11, 2015 · 4 comments

Comments

@andrewmunsell
Copy link

Right now, the generated PHP client SDK uses a generic namespace (SwaggerClient) and generic class names for some of the classes (Configuration, for example). This could cause conflicts if multiple Swagger based API SDKs were included in a single project.

The namespace of the generated API SDKs should be specific to the API itself, either generated automatically from the API name, or specified manually.

@wing328
Copy link
Contributor

wing328 commented Jul 12, 2015

@andrewmunsell may I know if you've tested the PHP client in the develop_2.0 branch? You can also customize the PHP client via a config.json, e.g.

java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
  -i http://petstore.swagger.io/v2/swagger.json \
  -l php \
  -o /var/tmp/php/ \
  -c /var/tmp/config.json

and here is the available option in the config.json

java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l php

CONFIG OPTIONS
    modelPackage
        package for generated models

    apiPackage
        package for generated api classes

    packagePath
        main package name for classes

    srcBasePath
        directory directory under packagePath to serve as source root

@who
Copy link
Contributor

who commented Jul 14, 2015

@wing328 @andrewmunsell

I have filed a PR to fix this here: #977

@wing328
Copy link
Contributor

wing328 commented Jul 15, 2015

Thanks @who. The PR has been merged into develop_2.0 branch.

@andrewmunsell please test to see if you're happy with the latest PHP client in develop_2.0 branch.

@wing328
Copy link
Contributor

wing328 commented Jul 23, 2015

@andrewmunsell we're closing this issue since we've not heard from you. Please open a new one if needed.

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

No branches or pull requests

3 participants