Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in getReferenceSchema when namespace contains a dot character #439

Open
CristiV opened this issue Mar 14, 2023 · 0 comments
Open

Error in getReferenceSchema when namespace contains a dot character #439

CristiV opened this issue Mar 14, 2023 · 0 comments

Comments

@CristiV
Copy link

CristiV commented Mar 14, 2023

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant