Skip to content

type "integer,null" not converted to "number,null" #350

@Francexi

Description

@Francexi

Hi everyone,
I noticed that if a property is set with a complex type (for example integer,null) that is allowed by OpenAPI spec, it is not converted as expected to the correct "number,null"

I guess the problem is in this line

return type === 'integer' ? 'number' : type;

that is the only control. Probably the control should be changed to a regex match and replace. A quick and dirty proposal might be:

return "string" === typeof type ? type.replace(/^integer/, "number")  : type;

I did not test this throughly but might work since once we have got to that line, most of the checks on the type have already been done

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs infoMore information is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions