OpenAPITools / OpenAPITools/openapi-generator

[BUG][php] body name from x-codegen-request-body-name is ignored

Open
#9,123 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug Server: PHP
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Bug Report Checklist
  • [x ] Have you provided a full/minimal spec to reproduce the issue?
  • [x ] Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • [x ] Have you searched for related issues/PRs?
  • [x ] What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

After a conversion from swagger 2 to OAS3, i see a new parameter in my yaml file in my operation:
x-codegen-request-body-name: ListOfDefinitions

This parameter is ignored during the php compilation and I got an object named InlineObject instead

openapi-generator version

5.1.0

OpenAPI declaration file content or url
openapi: 3.0.1
info:
  title: test
  description: test
  version: 1.0.0
servers:
  - url: /
paths:
  /definitions:
    put:
      summary: test
      operationId: putTest
      requestBody:
        description: test
        content:
          application/json:
            schema:
              type: object
              properties:
                label:
                  type: string
                  description: label
        required: true
      responses:
        204:
          description: successful operation
          content: {}
      x-codegen-request-body-name: ListOfDefinitions
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix

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 with the supplied OpenAPI 3.0.1 declaration and the PHP generation for PUT /definitions, then trace how x-codegen-request-body-name is handled. Done means the generated PHP uses ListOfDefinitions instead of InlineObject, with coverage for this declaration and output.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, php
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.