MapLargeInc.Build.RestApi
4.124.0
dotnet add package MapLargeInc.Build.RestApi --version 4.124.0
NuGet\Install-Package MapLargeInc.Build.RestApi -Version 4.124.0
<PackageReference Include="MapLargeInc.Build.RestApi" Version="4.124.0" />
<PackageVersion Include="MapLargeInc.Build.RestApi" Version="4.124.0" />
<PackageReference Include="MapLargeInc.Build.RestApi" />
paket add MapLargeInc.Build.RestApi --version 4.124.0
#r "nuget: MapLargeInc.Build.RestApi, 4.124.0"
#:package MapLargeInc.Build.RestApi@4.124.0
#addin nuget:?package=MapLargeInc.Build.RestApi&version=4.124.0
#tool nuget:?package=MapLargeInc.Build.RestApi&version=4.124.0
MapLarge.Build.RestApi
This console app has these responsibilities:
- Generate an OpenApi definition file describing the MapLarge Rest API.
- Generate MapLarge Rest API client libraries for various languages.
It is automatically executed as part of the build process by a custom MSBuild task, and the resulting openapi.json file and RestClient for js/ts is included in the MapLarge.Server deployment package.
OpenApi.json File Generation
The MapLarge.Server DLL is scanned using reflection. Information about the Rest API endpoints, inputs, and outputs is extracted and written to the MapLarge.Server/restapi/v1/openapi.json file. In order to load the MapLarge.Server assembly so that it can be scanned, this tool must have the same target framework as the MapLarge.Server project, which is why this was implemented as a .NET Core Console app, instead of just as an MSBuild task, because MSBuild tasks use .NET Framework instead of .NET Core.
The resulting file follows the OpenApi Specification, version 3.
Rest Client Generation
After the openapi.json file is generated, its contents are used to generate client libraries.
Supported Languages
This tool is currently capable of generating clients for the following languages:
- TypeScript/JavaScript
- Supported platforms:
- Modern browsers.
- NodeJS. Requires a Fetch API polyfill such as node-fetch.
- Older browsers (IE 10 or newer). Requires a Fetch API polyfill such as fetch-ponyfill, and a Promise polyfill such as es6-promise.
- Included in MapLarge JS API as MapLarge.Server/v4/servers/rest/RestClient.js and RestClient.d.ts.
- Supported platforms:
Planned Languages
Support for the following languages is planned for the future. The versions listed below are tentative, but thought has gone into their selection.
- Python 3.1 or newer.
- Python 3 is strongly recommended for any new development.. If there is need for Python 2 support, then it could be added as an additional supported language.
- Python 3.4 enums have been back-ported to 3.1
- .NET Standard 2.0 (C#, etc.)
- Supported platforms:
- .NET Framework 4.6.1 or newer.
- .NET Core 2.0 or newer.
- .NET 5.0 or newer
- Supported platforms:
- Java 11 or newer.
- Java 11 includes the non-preview version of HttpClient.
- Some companies are stuck supporting Java 8, so we might possibly need to support that version too.
- C/C++
Client Generator Implementation
The client generators use T4 templates for the dynamic content. To add a new template:
- To add a new runtime T4 template:
- Add → New Item...
- Search for "t4".
- Select "Runtime Text Template".
- Enter a filename, such as
ObjectTemplate.tt. - Click Add.
- Right click the new file and select "Properties"
- Change the "Custom Tool" property from
TextTemplatingFileGeneratortoTextTemplatingFilePreprocessor.
- Then add a partial class for additional custom C# code for the new template.
- Add → Class...
- Enter a filename, such as
ObjectTemplate.partial.cs. - Click Add.
- Edit the class modifiers in the new file from
classtopublic partial class.
- And just for the sake of cleanliness, nest the
*.partial.csfile under the*.ttfile.Edit
MapLarge.Build.RestApi.NetCore.csproj.Add a new element similar to the following (replace the paths and filenames with the appropriate values):
<Compile Update="RestClient\Generators\TypeScript\ObjectTemplate.partial.cs"> <DependentUpon>ObjectTemplate.tt</DependentUpon> </Compile>
Execution
This tool is executed by the custom MSBuild task named
BuildRestApiTask.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- CommandLineParser (>= 2.6.0)
- GeoJSON.Net (>= 1.2.19)
- MapLarge.Common (>= 1.0.0)
- MapLarge.Util.Build.NetStandard (>= 1.0.0)
- MapLarge.Util.NetStandard (>= 1.0.0)
- Microsoft.AspNetCore.Mvc.Core (>= 2.2.5)
- Newtonsoft.Json (>= 13.0.3)
- System.CodeDom (>= 8.0.0)
- System.Net.Http (>= 4.3.4)
- System.Text.Encodings.Web (>= 10.0.2)
- System.Text.Json (>= 10.0.2)
- System.Text.RegularExpressions (>= 4.3.1)
- YamlDotNet (>= 11.2.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.124.0 | 88 | 2/18/2026 |
| 4.120.1-alpha | 40 | 2/18/2026 |
v4.124
- Initial public release