Skip to content

PHP - doc comments with */ lead to invalid code #5635

Open

Description

kiota generate -d https://raw.githubusercontent.com/APIs-guru/openapi-directory/gh-pages/v2/specs/github.com/api.github.com/1.1.4/openapi.json -l PHP

and attempting to build the client leads to

 ------ ------------------------------------------------------------ 
  Line   client/Models/CodeScanningAlertDismissedReason.php          
 ------ ------------------------------------------------------------ 
  9      Syntax error, unexpected T_STRING, expecting ';' on line 9  
 ------ ------------------------------------------------------------ 

 ------ ----------------------------------------------------- 
  Line   client/Models/DeploymentBranchPolicyNamePattern.php  
 ------ ----------------------------------------------------- 
  18     Syntax error, unexpected '*' on line 18              
  83     Syntax error, unexpected '*' on line 83              
 ------ ----------------------------------------------------- 

This is caused by the presence of */ in the doc comment. Removing the value fixes the problem. It should be escaped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Type

Projects

  • Status

    Todo 📃

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions