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
  • #2004
Closed
Open
Issue created Jan 28, 2019 by Administrator@rootContributor

[BUG][PHP] Replace `File.separator` in PHP generators with `/` (Windows)

Created by: jfastnacht

Description

In the PHP Codegen files (e.g. AbstractPhpCodegen.java and PhpSymfonyServerCodegen.java) there is a lot of usage of the File.seperator placeholder. While it doesn't make a difference for Linux and Mac users, it does for Windows users of the codegen, especially if the placeholder, which will become a backslash, is mixed with hardcoded forward slashes. In PHP there is no reason to make Windows specific excuses, so everything should be replaced with forward slashes.

Anyways, since it is dangerous to just replace everything due to possible side effects and I don't wanted to replace huge chunks of code used in several generators by myself without telling anyone, I've decided to put this into an issue, discuss it and get feedback from the PHP Technical Comittee on it.

I've already changed some files in #1892 , but I think it's better to make proper bug PRs for fixing the slash issue and the main issue of the #1892 seperately.

openapi-generator version

master-branch

Command line used for generation

Any PHP generator under Windows.

Steps to reproduce
  1. Generate PHP code (Windows)
  2. Check changes with git status
Related issues/PRs
  • #1892 already changed some of the File.seperator placeholders to slashes
Suggest a fix

Replace File.seperator with slashes in PHP code generators.

Assignee
Assign to
Time tracking