[REQ][Slim4] Add package name and version to composer.json
Created by: nschilling
Is your feature request related to a problem? Please describe.
I'm using php-slim4 to generate server code for our API. I want to integrate the generated package in our project with composer using a custom repository of type "path".
Unfortunately the composer.json generated by php-slim4 is missing the required keys name
and version
.
Describe the solution you'd like
name
and version
should be added to modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache
like is is in modules/openapi-generator/src/main/resources/php/composer.mustache
. That would solve the problem.
{
"name": "{{gitUserId}}/{{gitRepoId}}",
{{#artifactVersion}}
"version": "{{artifactVersion}}",
{{/artifactVersion}}
...
}
Describe alternatives you've considered
At the moment I use a custom composer.mustache
when generating the server code. It is just a copy of the repository version with the above lines added. Unfortunately I'll will have to update the file manually every time php-slim4 changes dependencies.
Additional context
The same problem applies when using php-silex and maybe other php-* generators. It would be nice to have more uniform composer.json
files among the those generators.