asyncapi / modelina

A library for generating typed models based on inputs such as AsyncAPI, OpenAPI, and JSON Schema documents with high customization
https://modelina.org
Apache License 2.0
317 stars 184 forks source link

Add runtime tests for Dart #1744

Closed jonaslagoni closed 1 month ago

jonaslagoni commented 10 months ago

Reason/Context

To properly test that the models that are generated are semantically correct, we need to test them in their specific runtime. This means that we need to add the setup for Dart.

We already have a bunch of existing runtime tests for the other languages, that you can use as reference implementation: https://github.com/asyncapi/modelina/tree/master/test/runtime

Here is the TODO to solve this issue:

That should be it to add runtime testing.

If you encounter any problems just reach out :v:

akkshitgupta commented 9 months ago

While testing the generated Dart code from the generic-input.json using the dart run command within the runtime-dart folder, I am getting the following error.

Building package executable... 
Failed to build runtime_dart:runtime_dart:
lib/Address.dart:1:8: Error: Error when reading 'lib/nested_object.dart': No such file or directory
import 'package:runtime_dart/nested_object.dart';
       ^

since the file generated from the generator is NestedObject.dart and not nested_object.dart. any suggestions how can I move ahead. In my investigation I found that Dart supports snake-case for packages.

Also, as I'm not very much familiar with Dart language, it would be a great help if you can tell me how to write the entry point code for the runtime-dart.dart file here.

jonaslagoni commented 9 months ago

Cant help you much with dart unfortunately... Maybe try and reach out on the AsyncAPI slack channel #tooling

github-actions[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart: