question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generated model requires unknown imports

See original GitHub issue

Describe the bug

At the moment the generators have no way of telling the user which imports they require.

For example, for the Java generator, it generates enums with the expectation of com.fasterxml.jackson library to be present, however, the user has no way of knowing it is.

Expected behavior

I expected to be able to generate the model as is, without having to require me to dig into the generator to figure out which imports/required libraries are needed.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jonaslagonicommented, Jun 10, 2021

We can add helper array in each generation of model where dev/user can pass needed dependencies in presets/generators for given model. Something like we have for getNearestDependencies() function, but as an array/object 😃

@magicmatatjahu Good idea 👍

I just see a dilemma down the line. You now have a list of dependencies that are required for the model. But in your project (where the user output writes the models to) we require you to manually add those (dynamic) dependencies to your project dependencies… Then the user would need to “know” about the dependencies anyway 😕 Of course it helps in importing the dependencies in the model output file, just not for the project itself.

0reactions
asyncapi-botcommented, Jun 15, 2021

🎉 This issue has been resolved in version 0.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to import transformers · Issue #11262 - GitHub
I got this error when importing transformers. Please help. My system is Debian 10, Anaconda3. $ python Python 3.8.5 (default, Sep 4 2020, ......
Read more >
"Unknown named module" error in react native - Stack Overflow
I'm creating an app using react native but some imports raise the error from the title: "Unknown named module" .
Read more >
How to Fix ImportError: Cannot Import Name in Python - Rollbar
The Python ImportError: cannot import name error occurs when an imported class is not accessible or is in a circular dependency.
Read more >
unknown for model - ServiceNow Community
The created records are pointing 'model name' to unknown. ... the same model with the name 'unknown' model for all 355 records it...
Read more >
Python import: Advanced Techniques and Tips
The Python import system is as powerful as it is useful. In this in-depth tutorial, you'll learn how to harness this power to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found