swagger-api / swagger-api/swagger-codegen-generators

Problem in generating PHP client.

Open
#455 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
299
Forks
439
PR merge metrics
No merged PRs in 30d

Description

https://github.com/swagger-api/swagger-codegen-generators/blob/bd861a0313c7977765b19020c2d2b91a854000ed/src/main/resources/mustache/php/ObjectSerializer.mustache#L286

I am testing DISCRIMINATOR functionality and find out that this line is not correctly converted to final source.

$subclass = '{{invokerPackage}}\Model\\' . $data->{$discriminator};

I am using version 3.0.11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/main/resources/mustache/php/ObjectSerializer.mustache around line 286 and reproduce the discriminator generation problem with swagger-codegen-generators 3.0.11. Inspect the generated PHP client to determine the expected conversion of the referenced template expression; done means discriminator handling produces valid PHP source. No test file is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.