leonhard-s / auraxium

A high-level Python wrapper for the PlanetSide 2 API.
https://auraxium.readthedocs.io/
MIT License
28 stars 8 forks source link

Move payload validation to OpenAPI spec #63

Open leonhard-s opened 1 year ago

leonhard-s commented 1 year ago

The Auraxium object model is strongly tied to the Census payload format. This format changes, occasionally with limited notice, and it is unreasonable to require a new Auraxium version every time.

An OpenAPI spec for the game is maintained at ps2-api-docs, and the classes generated from it are extremely similar to the data model described by auraxium.models and auraxium.ps2. It would aid maintainability to simply use that API spec, with auraxium.ps2 only providing convenience wrappers and helper methods on top of it.

This should also include a hook for users to inject their own modified API specs on a per-client basis, either to locally patch Auraxium for recent API changes, or to use a third-party endpoint (such as Sanctuary.Census) whose payloads may not perfectly match the DBG Census.