[Slim] Update README template

I'm not sure about `middlewareSrcPath` variable. I'll fix it in following PRs
if path is broken.
Hope that notice in README catches attention and most of users will read it.
This commit is contained in:
Yuriy Belenko
2018-07-20 04:58:33 +05:00
parent 6a8e03079a
commit 204ee02fd8
2 changed files with 15 additions and 1 deletions

View File

@@ -118,6 +118,9 @@ public class PhpSlimServerCodegen extends AbstractPhpCodegen {
additionalProperties.put("middlewarePackage", middlewarePackage);
// make middleware src path available in mustache template
additionalProperties.put("middlewareSrcPath", "." + File.separator + toSrcPath(middlewarePackage, srcBasePath));
supportingFiles.add(new SupportingFile("README.mustache", getPackagePath(), "README.md"));
supportingFiles.add(new SupportingFile("composer.mustache", getPackagePath(), "composer.json"));
supportingFiles.add(new SupportingFile("index.mustache", getPackagePath(), "index.php"));

View File

@@ -7,4 +7,15 @@ is an example of building a PHP Slim server.
This example uses the [Slim Framework](http://www.slimframework.com/). To see how to make this your own, please take a look at the template here:
[TEMPLATES](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources/slim/)
[TEMPLATES](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources/php-slim-server/)
{{#authMethods}}
{{^hasMore}}
## Authentication
{{/hasMore}}
{{/authMethods}}
{{#authMethods}}
{{#isBasic}}
> Important! To make Basic Authentication work you need to implement `verifyCredentials` method in [AuthBasic]({{middlewareSrcPath}}\AuthBasic.php) class.
{{/isBasic}}
{{/authMethods}}