Skip to content
master
Switch branches/tags
Code
This branch is up to date with master.
Contribute

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

GhostSharper - Bungie API C# classes

This project implements C# classes for the Bungie.net API. While it does provide class definitions for API responses, it does not provide API helpers to call the API itself - that's up to you. The code is completely generated from Bungie's documentation - I previously the OpenAPI codegen tool, but found the generated code to be too messy so I opted for a custom generator so we could make the result as nice as possible.

Install

Published to Nuget as GhostSharper.

Usage

There are definitions for every type defined in the Bungie.net services. See their documentation for a list - the interface names are the last part of the full name (for example, Destiny.Definitions.DestinyVendorActionDefinition becomes DestinyVendorActionDefinition).

All definitions, enums, and API responses are on the GhostSharper.Models namespace. Additionally, GhostSharper.Api.DestinyServerResponse (name pending change) is a generic type used for API responses. e.g.

using GhostSharper.Api;
using GhostSharper.Models;

var jsonString = await getHttpAsync("https://www.bungie.net/Platform/Destiny2/Manifest");
var manifestResponse = JsonConvert.DeserializeObject<DestinyServerResponse<DestinyManifest>>(response.Content);
Debug.WriteLine(manifestResponse.Response.Version)

Updates

This repo and the published package is automatically updated using Github Actions when the API spec in the Bungie.net API repo is update. The package version number published to NuGet matches the version from the Bungie API spec.

Build

Node and Yarn is required for the generator. Node 14.x has been tested.

yarn --cwd ./generator install
yarn --cwd ./generator start
dotnet pack -nowarn:CS0659 -nowarn:CS0472 --include-symbols --include-source -c Release

Have a nice day.

About

C# classes for the Bungie.net API

Resources

License

Stars

Watchers

Forks

Packages

No packages published