Awesome
UnityOpenApi
Open API parser and client generator for Unity
Concept diagram
Purpose
Parsing OpenAPI documents and creating reusable Unity assets for easy API consuming in your Unity projects. Designed to work on any target platform.
Getting Started
Use Api Parser ScriptableObject to parse OpenAPI description from file or url. You will be prompted to select the folder where to put the generated API assets. You can select the same folder next time to update assets, this will aslo assure to preserve all existing references to these assets within the project.
There are 2 types of assets generated:
- The main API Asset containing all common data and settings
- The path assets for each individual path in the API, these assets are then references in different places of your project to consume the API.
Prerequisites
Unity 2018.3 was used, but it should be compatible with older versions as well.
Installing
Just clone the repository and open the project in Unity. All meta files are preserved. During the first launch, Unity can take a bit to generate caches.
Running the tests
There are no automated tests for now
Third party libraries and packages
- Editor Coroutines - allows you to test web requests in editor without hitting play button
- JSON.NET for Unity - parsing your data
- OpenAPI.NET - parsing Swagger and OpenAPI3 documents (JSON and YAML)
- RestClient - Multiplatform promise based Http Handler
Roadmap
- support all http methods
- authorization assets generation and automatic use for where required
- data model generation
- better http response wrapper, support for progress callbacks/events
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Authors
- Kolodi - Initial work - kolodi
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Acknowledgments
- Inspired by OpenAPI Tools