Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #239
Closed
Open
Issue created Jun 06, 2018 by Administrator@rootContributor

OpenAPI generator not following the specification regarding to schemes - PHP

Created by: thomasphansen

Description

According to the OpenAPI-Specification v2.0, for the fixed field "schemes":

The transfer protocol of the API. Values MUST be from the list: "http", "https", "ws", "wss". If the schemes is not included, the default scheme to be used is the one used to access the Swagger definition itself.

The link below points to the swagger definition for the TripleTex API. Please, notice that the "schemes" field is NOT defined.

Swagger php generator works perfectly for this definition. This is a snippet from the lib/Configuration.php file:

class Configuration
{
    # (...)

    /**
     * The host
     *
     * @var string
     */
    protected $host = 'https://tripletex.no/v2';

   # (...)
}

However, when I use OpenAPI generator, the Configuration class lacks the "https" information:

class Configuration
{
    # (...)

    /**
     * The host
     *
     * @var string
     */
    protected $host = 'tripletex.no/v2';

   # (...)
}

Also, if I download the json file and run the swagger generator, it will by default add the https, while OpenAPI generator will continue to give the same output above. This is not a surprise, since there is nothing on the OpenAPI specification that would suggest this "default" behaviour - even if it is a breaking change. But the first situation (getting the scheme from the swagger definition URL) is clearly a bug...

openapi-generator version

v3.0.0

OpenAPI declaration file content or url

https://tripletex.no/v2/swagger.json

Command line used for generation

docker pull openapitools/openapi-generator-cli docker run
--user $(id -u):$(id -g)
--rm -v ${PWD}:/local openapitools/openapi-generator-cli:v3.0.0 generate -i https://tripletex.no/v2/swagger.json
-l php
-o /local
-c /local/config.json

Steps to reproduce
  1. create a local config.json file, with the following content:
{
	"invokerPackage": "Tripletex",
	"modelPackage": "Model",
	"apiPackage": "Api",
	"packagePath": "",
	"composerVendorName": "spysystem",
	"composerProjectName": "tripletex-integration"
}
  1. check the generated file lib/Configuration.php for the protected $host parameter
Related issues/PRs
Suggest a fix/enhancement
Assignee
Assign to
Time tracking