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

[PHP] [ObjectSerializer] Call to undefined method stdClass::swaggerFormats()

Open
#822 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

Hi!
I wanna build php client for Flagr. There are some models that have property with JSON object.
It may look like this:
{ "prop1": { "prop2": { "prop3": "propValue" } } }

So, when I try to serialize this model, then I catch Exception:
Call to undefined method stdClass::swaggerFormats() at ...flagr-php-client/lib/ObjectSerializer.php:65

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 lib/ObjectSerializer.php:65 and reproduce serialization of a model containing the nested JSON object shown in the report. Trace why the nested stdClass is treated as requiring swaggerFormats(), then verify that serializing this model completes without the undefined-method exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.