hiranthaR / Json-to-Dart-Model

Json to Dart Model extension can convert JSON objects into Dart data classes. It supports pure Dart class conversion, Flutter-recommended JSON serialization using annotations, Freezed support, Effective Dart:Style, and many more features. Currently, it has more than 135,000 installs.
https://marketplace.visualstudio.com/items?itemName=hirantha.json-to-dart
MIT License
93 stars 17 forks source link

File system provider is not available #6

Closed ansarizafar closed 4 years ago

ansarizafar commented 4 years ago

I am getting this error. Is there anything I can do to solve this issue.

Please select a valid directory
File system provider for e:%5CProjects%5CRestock%5CClients/lib/ is not available.
hiranthaR commented 4 years ago

@ansarizafar Can you check with a new project, please. It is like something went wrong with the Windows file system path. I can fix this, but I have an exam these days. Do you need the fix immediately?

ansarizafar commented 4 years ago

Without the fix the extension is not useable. It would be great If you can fix it as soon as possible.

ElZombieIsra commented 4 years ago

Hi @ansarizafar , can you provide your system info and the steps to follow to reproduce this error?

I can probably look into this @hiranthaR

hiranthaR commented 4 years ago

@ElZombieIsra Thank you very much. looks like windows provide workspace.rootPath (index.ts line 188) as like E:\Projects\Restock format.

hiranthaR commented 4 years ago

@ansarizafar Temporary fixed. I'll fix it after my exam :slightly_smiling_face:

Dichill commented 3 years ago

Still having issues with this one. Any workarounds?

File system provider for d:/flutterprojects/myapp/lib/ is not available.

Tried going to other projects and it seems to produce the same results.

iamarnas commented 3 years ago

@Dichill Hi 👋

Can I get more DETAILS to improve it? When you have begin getting this error. After last update? Which operation system? Which method you use to convert JSON models? I have tested it on Mac today before release l not get some error?

Dichill commented 3 years ago

@Dichill Hi 👋

Can I get more DETAILS to improve it? When you have begin getting this error. After last update? Which operation system? Which method you use to convert JSON models? I have tested it on Mac today before release l not get some error?

Hello! Sorry for the very late reply, I didn't check my notifications. It is my first time using this extension so I'm guessing that its the latest update. My operating system is Windows 10 Home, for my methods to convert Json Models is Json to Dart: From Clipboard and any Json string produces that error. The Directory of my project is D:\flutterprojects\my_project Location for my Vscode is C:\Users\Dichill\AppData\Local\Programs\Microsoft VS Code

iamarnas commented 3 years ago

@Dichill Thank you for your answer I think I know what is problem. I will try to fix with next release.

Dichill commented 3 years ago

@iamarnas Okay, thank you for the quick response, stay awesome!

iamarnas commented 3 years ago

@Dichill Hi. Have you same problem if you convert JSON from the file models.jsonc convert from the file.

Dichill commented 3 years ago

@Dichill Hi. Have you same problem if you convert JSON from the file models.jsonc convert from the file.

Hello! It works just fine. There were no errors and such, it successfully created a folder and a dart file.

iamarnas commented 3 years ago

@Dichill Thank you so much for your help. It was very helpful.

Dichill commented 3 years ago

@Dichill Thank you so much for your help. It was very helpful.

no problem! Glad I could help :))

iamarnas commented 3 years ago

@Dichill 👋 Could you try the latest version to see if the problem is gone?

Dichill commented 3 years ago

@Dichill 👋 Could you try the latest version to see if the problem is gone?

Hello! I tried it again but the problem is still there. Just to clarify here are the steps that I did to test the extension.

  1. Copy the Json { "glossary": { "title": "example glossary", "GlossDiv": { "title": "S", "GlossList": { "GlossEntry": { "ID": "SGML", "SortAs": "SGML", "GlossTerm": "Standard Generalized Markup Language", "Acronym": "SGML", "Abbrev": "ISO 8879:1986", "GlossDef": { "para": "A meta-markup language, used to create markup languages such as DocBook.", "GlossSeeAlso": ["GML", "XML"] }, "GlossSee": "markup" } } } } }
  2. Ctrl + Shift + P
  3. JSON to Dart : From ClipBoard -> User -> No -> No -> No -> No -> Enter (Json Default)
Dichill commented 3 years ago

Hello again! I restarted VSCode and the error is gone! However the files doesn't get created, it just asks me to select the folder to create the models and once I select the folder no files were generated.

EDIT: { "r@id": 1, "d@title": "Json To Dart Model" }

works great and it works! although for the glossary one it seems like there's something wrong with the format.

iamarnas commented 3 years ago

@Dichill Thanks for the detailed information. I'll look into this as soon as possible.

Dichill commented 3 years ago

Hello! It seems to work fine if add annotations e.g.

{
    "id" :1768,
    "title": "SM SKATING AND BOWLING",
    "location": "SM Skating Rink",
    "date": "Dec 31, 2021",
    "link": "https://smtickets.com/events/view/9505",
    "image":"https://images1.smtickets.com/images/portrait_02032021100012.jpg"
}

👇

{
    "r@id": 1768,
    "d@title": "SM SKATING AND BOWLING",
    "d@location": "SM Skating Rink",
    "d@date": "Dec 31, 2021",
    "d@link": "https://smtickets.com/events/view/9505",
    "d@image": "https://images1.smtickets.com/images/portrait_02032021100012.jpg"
}

And that seems to convert just fine, although it seems like a tedious process, am I doing it wrong when converting it? Or annotations is really needed?

iamarnas commented 3 years ago

@Dichill You don't need use annotation it's only if you want tell to generator that you want expected value generate as required or with default value. Normally you convert raw JSON.

iamarnas commented 2 years ago

@Dichill Hi 👋

Can you test latest 3.5.3 version to see if no issues?

Dichill commented 2 years ago

@Dichill Hi 👋

Can you test latest 3.5.3 version to see if no issues?

Hello! Sorry for the late reply, Yes its working great now! Thank you so much :)) Keep up the great work you guys are doing. Its game changing for both me and the flutter community <3

iamarnas commented 2 years ago

@Dichill Nice to hear that you like it and works well without issues. Thank for you help and sorry for my mistakes 🙂

Dichill commented 2 years ago

@Dichill Nice to hear that you like it and works well without issues. Thank for you help and sorry for my mistakes 🙂

Its okay :)) programming is all about trial and error :)