Creating Visual Studio Packages from a REST Schema - problems
I am writing software for a Myob-Acumatica user. I am using the Integration Development Guide
2025 R1. I have been able to download swagger.json using something like:
https://MyUser.myobadvanced.com/entity/default/23.200.001/swagger.json?company=TestCo
(MyUser has replaced the actual company reference)
Following the instructions on page 51 of the documentation, I uploaded swagger.json to:
https://editor.swagger.io
The first line of the JSON file was, "swagger: '2.0'". I found that I needed to convert to OpenAPI 3.0 so that the .json file was error free in the editor.
As per the documentation instructions I generated the client (step 5) as c#
The csharp-client-generated.zip file was duly downloaded to my computer and contained two Visual C# projects, IO.Swagger and IO.Swagger.Test. I unzipped the file and loaded the solution into my Visual Studio 2022 (Version 17.12.3).
However, the application build process is unsuccessful because many if not all the .cs files contain constructors with parameters that are repeated. For instance, in the model folder is a file called ACAInfoDetail.cs which has a constructor that looks like this:
public ACAInfoDetail(StringValue coverageType = default(StringValue),
StringValue healthPlanType = default(StringValue),
StringValue coverageType = default(StringValue),
StringValue healthPlanType = default(StringValue),
Guid? id = default(Guid?),
long? rowNumber = default(long?),
StringValue note = default(StringValue),
Dictionary<string, Dictionary<string, CustomField>> custom =
default(Dictionary<string, Dictionary<string, CustomField>>),
string error = default(string),
List<FileLink> files = default(List<FileLink>))
: base(id, rowNumber, note, custom, error, files)
The first and third parameter both have the same variable name StringValue coverageType
Why does the generated client have this problem and what changes do I need to make to successfully build this application?