OpenAPITools / OpenAPITools/openapi-generator

[REQ][Slim4] Add package name and version to composer.json

Open
#5,054 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache and compare its Composer metadata with modules/openapi-generator/src/main/resources/php/composer.mustache. Update the Slim4 template so generated composer.json files include the requested name and version fields, then verify the rendered output for the stated package metadata.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, devtools
Issue type
Feature
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.