Skip to content

geriremenyi/oanda-openapi

Repository files navigation

OpenAPI Specification for OANDA's v20 REST API

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.

Demo

The specification is published using SwaggerUI hosted on this repo's github page:

https://geriremenyi.github.io/oanda-v20-openapi

Getting started

Prerequisites

Local setup

  1. Clone this repo
git clone https://github.com/geriremenyi/oanda-v20-openapi.git

or

git clone git@github.com:geriremenyi/oanda-v20-openapi.git
  1. Navigate to the root of the cloned project and install all dependencies
yarn install

Bundle

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.

Validate

To validate that the specification complies with the OpenAPI 3 standards run the following commands:

  1. Separate files with relative reference resolution
yarn validate:original
  1. Bundled version
yarn validate:bundled

Generate code

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.

Generated client repos

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.

C# (.NET core)

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

Contribution

Read more

License

MIT

Releases

No releases published

Packages

No packages published

Languages