This repository contains a more organized version of the generated OANDA v20 REST API's OpenAPI specification. The specification is rewritten to leverage OpenAPI's newest (3.x.x) syntax. Specifications are moved to separate files and redundancy is removed.
The specification is published using SwaggerUI hosted on this repo's github page:
https://geriremenyi.github.io/oanda-v20-openapi
- Node for dev environment,
- Yarn for package dependencies.
- (optional) Visual Studio Code for IDE.
- Clone this repo
git clone https://github.com/geriremenyi/oanda-v20-openapi.git
or
git clone [email protected]:geriremenyi/oanda-v20-openapi.git
- Navigate to the root of the cloned project and install all dependencies
yarn install
To combine seperate .yaml
files into one openapi sperification run the following command:
yarn bundle
While the whole point of the repository is to separate individual models and endpoints into seperate files most of the tools cannot handle relative
$ref
properly. The code generator tool breaks from version to version. For more details on the problem see the code generator bugs.
To validate that the specification complies with the OpenAPI 3 standards run the following commands:
- Separate files with relative reference resolution
yarn validate:original
- Bundled version
yarn validate:bundled
To generate C# (.NET core) client run the following command:
yarn generate:csharp-netcore
You can add more code generators via defining it in the config folder and creating a new run command in the package.json.
TODO rewrite this section
There is a continuous integration job setup which runs on every pull request. This makes sure that the definition is syntactically correct.
There is also a continuous deployment job setup which runs on every merge to master. This generates the client codes and pushes them to the corresponding GitHub repos.
The generated C# code is pushed to nuget.org on every push to the target client repository.
Repository: https://github.com/geriremenyi/oanda-dotnet-client
Nuget package: https://www.nuget.org/packages/GeriRemenyi.Oanda.V20.Client/
TODO end