Skip to content

[BUG] [typescript-fetch] generated API references undeclared function objectToJSON #22000

@luketudge

Description

@luketudge

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator?
  • 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

With a schema that contains an object as a property, generation for typescript-fetch produces an invalid client that contains a reference to an undeclared function objectToJSON.

openapi-generator version

latest (via docker hub)

OpenAPI declaration file content or url

See reprex at https://github.com/luketudge/openapi-reprex

Generation Details
docker run --rm \
    -v "${PWD}:/local" \
    openapitools/openapi-generator-cli generate \
    -i /local/openapi.json \
    -g typescript-fetch \
    -c /local/openapi_gen_config_typescript.json \
    -o /local/typescript
Steps to reproduce

https://github.com/luketudge/openapi-reprex

Related issues/PRs

Looks like a regression of #19280 but in a special case. Whereas the very similar bug reported there occurs for a schema in which the top-level item is declared as type 'object', the bug here is the same thing, but with a property that is declared as type object.

Suggest a fix

I'm looking into it. Not sure yet.

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