OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.42k stars 6.48k forks source link

Does it not support versions below php7, such as php5.6 #12406

Open shifpeng opened 2 years ago

shifpeng commented 2 years ago

In the template file, many syntaxes are only supported after php7, do you support php5.6?

    "require": {
        "php": "^7.4 || ^8.0",
        "ext-curl": "*",
        "ext-json": "*",
        "ext-mbstring": "*",
        "guzzlehttp/guzzle": "^7.3",
        "guzzlehttp/psr7": "^1.7 || ^2.0",
        "tencent/tls-sig-api-v2": "1.0"
    },
wing328 commented 2 years ago

You can use old releases of openapi-generator which supports php 5.x

shifpeng commented 2 years ago

You can use old releases of openapi-generator which supports php 5.x

yerp, I found it. The version is 3.3.4, which is the previous version of 4.x. I am confirming whether the version is normal. It is recommended to increase the compatibility of the PHP version with the latest version.

wing328 commented 2 years ago

why not upgrade to new version of PHP in your environment?

shifpeng commented 2 years ago

why not upgrade to new version of PHP in your environment?

The customer base is more complex, and most users use PHP5, so it must be compatible with PHP5.6

In addition, I raised another question, that is, the use of template files in Java does not take effect. Can you help me with this question? #12430 Here is the link: https://github.com/OpenAPITools/openapi-generator/issues/12430

thomasphansen commented 2 years ago

Hello, My two cents: Php 5.6 hit EOL in 2018. The newer versions of php are faster, have new functionalities and help creating better and less-prune-to-errors libraries. Keeping compatibility with old versions on newer releases will prevent the php clients from evolving. For example: I'm working in a solution to bring support for "OneOf ", which involves using union types. Also, the new Enumerations could be used to enhance the handling of "enum" properties. Finally, typed parameters and properties are already in use by the client, and removing them would mean a big step back in code quality...