Skip to content
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

[BUG] [PHP] Generate correct composer.json metadata #14645

Closed
4 of 6 tasks
Poolmann opened this issue Feb 8, 2023 · 0 comments · Fixed by #16012
Closed
4 of 6 tasks

[BUG] [PHP] Generate correct composer.json metadata #14645

Poolmann opened this issue Feb 8, 2023 · 0 comments · Fixed by #16012

Comments

@Poolmann
Copy link
Contributor

Poolmann commented Feb 8, 2023

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

I noticed, that not all metadata properties in the composer.json file are exposed to the outside.

  • "name": depends on the git_id/git_repo
  • "version": comes from the artifactVersion setting in additional-properties in the cli
  • "description": from the .yaml spec
  • "homepage", "license", "authors": are not configurable at all

Shouldn't the "name" correlate to the packageName setting inadditional-properties?
The other properties are all accessible through the info object in the yaml specification.

    {{#composerPackageName}}
    "name": "{{.}}",
    {{/composerPackageName}}
    {{#artifactVersion}}
    "version": "{{.}}",
    {{/artifactVersion}}
    "description": "{{{appDescription}}}",
    "keywords": [
        "openapitools",
        "openapi-generator",
        "openapi",
        "php",
        "sdk",
        "rest",
        "api"
    ],
    "homepage": "https://openapi-generator.tech",
    "license": "unlicense",
    "authors": [
        {
            "name": "OpenAPI-Generator contributors",
            "homepage": "https://openapi-generator.tech"
        }
    ]
openapi-generator version

openapi-generator-cli 6.3.0

OpenAPI declaration file content or url
info:
  description: >-
    My description
  version: 4.1.0
  title: My title
  license:
    name: Proprietary
Generation Details

openapi-generator-cli generate -i openapi/openapi.yaml -g php -o clients/php --additional-properties artifactVersion=4.1.0,packageName=my/package,invokerPackage=MyPackage\\Client --global-property skipFormModel=false

Steps to reproduce
Related issues/PRs
Suggest a fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant