Skip to content

[BUG][SYMFONY-PHP] Type float is unsupported #15950

@loicconan

Description

@loicconan

Bug Report Checklist

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

When I'm using number type for a query parameter in OpenAPI Specification file, that generate a float type in PHP. However, the service JmsSerializer does'nt handles this type.

openapi-generator version

6.6.0

OpenAPI declaration file content or url
openapi: 3.0.3

info:
  title: API title
  description: API description
  version: 1.0.0

paths:
  /my-endpoint:
    get:
      description: Endpoint description
      parameters:
        - in: query
          name: annualSalary
          required: false
          schema:
            type: number
      responses:
        200:
          description: 'OK'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
Generation Details
openapi-generator-cli generate -i ./src/issue.yml -g php-symfony -o ./build/server/ --git-user-id=company-name --git-repo-id=project-name-server --additional-properties=bundleName=CompanyNameProjectNameServer,bundleAlias=company_name_project_name_server,invokerPackage=CompanyName\\\\ProjectNameServer,variableNamingConvention=snake_case,phpLegacySupport=false
Steps to reproduce

When request the endpoint, we get this error:
Type float is unsupported

Related issues/PRs
Suggest a fix

Error come from generated file : Service\JmsSerializer.php::deserializeString
Where $type with "float" has value is not handles.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions