Skip to content

Error in getReferenceSchema when namespace contains a dot character #439

@CristiV

Description

@CristiV

When the namespace contains dots, there is the following error:
Internal Error: #/components/schemas/Api.v1.ClassName not found!
at getReferenceSchema (D:\Projects\JVM.BackOffice\node_modules@openapi-codegen\typescript\lib\core\getReferenceSchema.js:20:15)

This happens because of line 18 in getReferenceSchema, which uses dot as a special separator character:
const referenceSchema = (0, lodash_1.get)(openAPIDocument, refPath.join("."));

The fix is to use the other overload of get which can accept an array directly, like the following:
const referenceSchema = (0, lodash_1.get)(openAPIDocument, refPath);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions