Missing Using Statements

Hello, when I generate my api from swagger, there are many files created that I do not recognize, and they are missing using statements (mostly System.Reflection) that is causing much refactoring each time I pull in new API definition updates. Can you help?

Hi @mcourville,

Can you post more info where these using statements are missing? Radzen generates on run various files from your data source definition to be used runtime: service, models, etc.

These are compile time files. When I import an API from a swagger document, it generates many files that are not related to the API like these classes are not part of the swagger, but they were generated:


and they are missing using statements.
mostly
Snippet

using System.Reflection;

I’m afraid that we are unable to reproduce such problem locally. Please send us your swagger definition or the entire application at info@radzen.com. If the archive is too big for attachment you can use sharing service like Google drive.

I have sent the swagger document, thanks!

I've tried your definition and no such files generated for me:


There is an error however not related to the problems described in your first post - one of the properties type is not properly generated:

should be IEnumerable<bool>.

Fix for this will be included in our next update before the end of the week and in the meantime you can add this file to application ignore list and correct the problem directly in the code.

well, in the API it's actually a nullable bool (IEnumerable<bool?>)

Yes, you are right - it's IEnumerable<bool?>.

Our other issue appears to be an artifact from an earlier import. After deleting and re-adding the swagger, the other files didn't come back. We'll look forward to the nullable bool fix.

Hi, our API this morning is generating more nullable objects as dynamic specifically, anything that is an IEnumerable<CLASS?> is being generated as IEnumerable<dynamic> . This started after updating to the latest today.

Thanks for the report. You can downgrade to the previous version until we find what’s going on.

We were able to fix the problem and we will publish update later today.